I thought everything was grand with my script, because testing it with a
test.bat works fine. But when I try to run a executable I get an error that
says wshShell is not recognized. I don't know if running it on XP makes a
difference. Can anyone help and/or suggest corrections.
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem")
Set colCDROM = objWMIService.ExecQuery("SELECT * FROM Win32_CDROMDrive")
Set WshShell = WScript.CreateObject("WScript.Shell")
For Each objItem In colItems
Select Case Trim(objItem.Model)
Case "OptiPlex GX270"
WshShell.run ("c:\roxio\test.bat"), 1, True
Case "Precision WorkStation 360"
WshShell.run ("c:\roxio\test.bat"), 1, True
Case "Precision WorkStation 370"
wshShell.run "c:\roxio\test.bat", 1, True
Case "Precision WorkStation 380"
wshShell.run "c:\roxio\test.bat", 1, True
Case "-------------------------"
wshShell.run "c:\roxio\test.bat", 1, True
Case Else
msgbox "Your PC does not match the models selected to recieve
software."
End Select
Next