Running a VBScript file with Scripting as SYSTEM is not executing
New to KACE and have a major deployment we need to have done by the end of the month (July, 2013).
Can't get the following script to run at all.
Major Information: Running the script as Online KScript
Status is Production
Enabled is checked
One test machine is seleted
All Microsoft Windows OS's are seleted.
Being run as a Local System
Has an alert before run - set for 3 minutes; dialog timeout action is OK; Snooze Duration is 3 min.
Only Don't Run on a Schedule is seleted
Dependencies include the script file to be run and another which will be scheduled to run as the logged on user at a later date.
Task 1 is attached as an image.
VBScript to create the task is below. I'm running the script by forcing an update. The Scripting Log is empty.
Set WSHNetwork = CreateObject("WScript.Network")
set objFSO = CreateObject("Scripting.FileSystemObject")
Set WShShell = CreateObject("WScript.Shell")
SystemDrive = WShShell.ExpandEnvironmentStrings("%SystemDrive%")
SystemRoot = WShShell.ExpandEnvironmentStrings("%SystemRoot%") ' usu. C:\Windows
System32 = SystemRoot & "\System32" msgTitle = "WesTech Engineering, Inc. "
msgDelay = 2 If not objFSO.FolderExists(SystemDrive & "\Temp") then objFSO.CreateFolder SystemDrive & "\Temp\"
set logFile = objFSO.OpenTextFile (SystemDrive & "\temp\CreateTask_" & WSHNetwork.ComputerName & "_" & WSHNetwork.username & ".txt",2, true )
logFile.writeline FormatDateTime(now,2) & " " & FormatDateTime(now,3) & " - Autodesk 2014 Update Started " & " Computer: " & WSHNetwork.ComputerName & " User: " & WSHNetwork.username Path = System32 & "\schtasks.exe /create /tn " & chr(34) & "UpdateAutodesk" & chr(34) & " /tr C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\281\UpdateAutodesk2014.vbs /sc once /st 05:00 /sd 08/03/2013"
Return = WShShell.Run(Path,1,TRUE) logfile.close
set objFSO = nothing
set WShShell = nothing