I'm an amateur VB scripter. I'm making a script to check to see if one of two files exists, and if so, give a flag that says "Installed". If neither file exists, flag "Not Installed". Here is my script...
Option Explicit
DIM fso
Set fso = CreateObject("Scripting.FileSystemObject")
CreateObject("WScript.Shell")
If (fso.FileExists("C:\Program Files (x86)\Dell\KACE\AMPAgent.exe")) OR (fso.FileExists("C:\Program Files\Dell\KACE\AMPAgent.exe")) Then
WScript.Echo("Installed")
WScript.Quit()
Else
WScript.Echo("Not Installed")
WScript.Quit()
End If
It works when I run it in Windows 7. When I add it to BGInfo, it throws up this error...
Error evaluating scripted field 'KACE'
Microsoft VBScript runtime error
Line 7, position 2
Variable is undefined: 'WScript'
[OK]
I think I just need a way to define or call WScript to action since it's obviously not doing it through BGInfo on its own, and what I did isn't working. I haven't seen anything to help with this particular problem on StackOverflow already.
Any thoughts?