I am a novice with vbscripting but have a desperate need for a script to do the following (EXTREMELY SIMILAR to the thread "Find if OS is x86 or x64 then Windows 7 or XP and run msi">
HOWEVER, all I need to do is test if the operating system is XP or NOT...and run a script
if XP I need to run
netswitchXP.vbs
ELSE
run netswitch.vbs
that is it.
I tried to modify the following (Ie...what am I doing wrong with this?)
strComputer = "."
Dim objWMI:Set objWMI = GetObject("winmgmts://" & strComputer & "\root\cimv2")
Set colItems = objWMI.ExecQuery("Select * from Win32_OperatingSystem", , 48)
For Each objItem in colItems
OSVersion = objItem.Caption
Next
Select Case OSVersion
Case "Microsoft Windows XP Professional"
cscript.exe netswitchXP.vbs, True
Case Else
cscript.exe netswitch.vbs
End Select
HELP please ~ and thank you so much...
HOWEVER, all I need to do is test if the operating system is XP or NOT...and run a script
if XP I need to run
netswitchXP.vbs
ELSE
run netswitch.vbs
that is it.
I tried to modify the following (Ie...what am I doing wrong with this?)
strComputer = "."
Dim objWMI:Set objWMI = GetObject("winmgmts://" & strComputer & "\root\cimv2")
Set colItems = objWMI.ExecQuery("Select * from Win32_OperatingSystem", , 48)
For Each objItem in colItems
OSVersion = objItem.Caption
Next
Select Case OSVersion
Case "Microsoft Windows XP Professional"
cscript.exe netswitchXP.vbs, True
Case Else
cscript.exe netswitch.vbs
End Select
HELP please ~ and thank you so much...