I have a VBScript I want to push out and execute on machines. I have targeted one test windows 7 machine. I am using Online KScript and added the .vbs file I want to execute as a dependency. I set the directory = $(KACE_SYS_DIR) and set the Parameters = "$(KACE_DEPENDENCY_DIR)\PurgeTempFiles.vbs"
the output log shows this.
Running as: SYSTEM Creating process returned non-zero: C:\Windows\System32\PurgeTempFiles.vbs "C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\56\PurgeTempFiles.vbs": (2) The system cannot find the file specified. Error Code: 2 Status Code: 0
The directory, file, and parameters fields must be configured correctly to successfully launch the VBS. If you're trying to call a dependency directly, you'd set directory to $(KACE_DEPENDENCY_DIR), set the file to PurgeTempFiles.vbs and you wouldn't need any parameters unless the VBS requires parameters. You may have to call the VBS file via something like cscript to get it to run properly. In that case, you'd set file to cscript.exe, and set parameters to $(KACE_DEPENDENCY_DIR)\PurgeTempFile.vbs.
You've got kind of a mixture of both of the methods I explained, so try modifying to suit one of them and you should have success. The script that you've described above is calling a directory with no file and then passing parameters - which I wouldn't expect to do succeed. From the log, it looks like it tried to run the VBS from the system directory - which isn't going to work unless you put that script there by some other means first.
If you require further assistance, please feel free to contact Dell KACE Support.
You should look into the potential issues caused by Kace being a 32 Bit application on 64 bit machines. Kace will run cscript as 32 bit by default. This could easily break your script or cause unwanted behavior.
On 64 bit machines you would want to use C:\windows\sysnative\ instead of $(KACE_SYS_DIR). On a 64 bit machine $(KACE_SYS_DIR) actually is launching cscript from the 32 bit directory C:\windows\syswow64\
This starts to become a very big headache when trying to make custom inventory rules or other sorts of scripts. Instead of using the launch a program, it might better to write a wrapper script or select run a batch file and do something like this:
if defined ProgramFiles(x86) (C:\windows\Sysnative\cscript.exe script.vbs) else (cscript.exe script.vbs)
There may not be a problem caused in that specific script, but I find that it is better to get in the habit of running under the proper architecture.
By continuing to use this site and/or clicking the "Accept" button you are providing consent
Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our
websites or when you do business with us. For more information about our
efforts, please visit