Wednesday, May 28, 2014

Identifying first two characters of machine name and 5th character of machine name using Wise Scripts

5th Character of Machine Name:

item: Get Registry Key Value
  Variable=HAR
  Key=SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName
  Value Name=ComputerName
  Flags=00000100
end
item: Parse String
  Source=%HAR%
  Pattern=5
  Variable1=HAR1
  Variable2=HAR2
  Flags=00001010
end
item: Parse String
  Source=%HAR1%
  Pattern=5
  Variable1=HAR1
  Variable2=HAR2
  Flags=00001010
end


item: If/While Statement
  Variable=HAR2
  Value=X
  Flags=00000100
end


First two Characters of Machine Name:

item: Get Registry Key Value
  Variable=HAR
  Key=SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName
  Value Name=ComputerName
  Flags=00000100
end
item: Parse String
  Source=%HAR%
  Pattern=4
  Variable1=HAR1
  Variable2=HAR2
  Flags=00001010
end
item: Parse String
  Source=%HAR%
  Pattern=2
  Variable1=HAR1
  Variable2=HAR2
  Flags=00001010
end

item: If/While Statement
  Variable=HAR1
  Value=AB
  Flags=00000100
end

Note: Copy the highlighted content to notepad and change to .wse format and use it




No comments:

Post a Comment