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"
logFile.writeline Path
Return = WShShell.Run(Path,1,TRUE) logfile.close
set objFSO = nothing
set WShShell = nothing
2 Comments   [ + ] Show Comments


  • It may not make a difference, but try removing the quotes around the parameters. Also run it by using the Run Now button.
  • It works if I hit Run now - I want it deployed to all computers in the company. I think my error might have been to not schedule it and expect it to magically run.
    • so this is working now or still no? You are wanting to run it on a schedule correct?
    • I would schedule it. Also set the verify task to check and see if it has already run. You can do this by copying down a blank .txt file, or changing a reg key. The next time the script is ran it checks for that .txt file. If it's there it will not run again. That way it's not running nonstop.

      With the verify set to look for the .txt file. Change the remediation to run your script.
Please log in to comment



I would do this to at least see if it runs, make sure all your scripts and stuff are in a zip file and uploaded to dependenices:

verify that a file exists


On success:

1. Unzip a file




2. Launch a program


File: wscript.exe

Parameters: yourscript.vbs

Checkmark next to Wait for completetion.

Answered 07/24/2013 by: areiner
Fourth Degree Black Belt

  • To Areiner - yes it is working now. For Dugullett - Let me see if I understand this correctly. I will have a Verify section that checks for the registry value (I prefer that to a text file)existence. Then I will have a Remediation section that runs the scipt identically to the way I did it before in the Verify section.
    • Yes. This way the script is not continually running on the same machines. Verify "a registry key exists". Then remediation the same steps you currently have. The next time the schedule is ran it will check the machine, and look for the registry key. If it does not exist it runs the remediation.
  • I should also add a section for On Remediation Success to create the registry entry so the verify works correctly after the first run. Thanks for your help.
Please log in to comment
Answer this question or Comment on this question for clarity