Kace1000 VBScript executing from dependency - Cannot find file specified error.
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
Answers (2)
Top Answer
Comments:
-
I am now getting this error. 193.
Output Log
Running as: SYSTEM
Creating process returned non-zero: C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\56\PurgeTempFiles.vbs : (193)
Error Code: 193
Status Code: 0
Activity Log
Launching program: 'C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\56\PurgeTempFiles.vbs' '' wait='true' - abrockhaus 9 years ago-
193 is a VBS error. You'll want to call cscript.exe and pass it the full path of the vbs as a parameter. This is the 2nd scenario I explained above. - airwolf 9 years ago
-
Ok using cscript.exe. getting invalid directory.
Output Log
Running as: SYSTEM
Creating process returned non-zero: C:\Windows\System32\cscript.exe C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\56\PurgeTempFiles.vbs: (267) The directory name is invalid.
Error Code: 267
Status Code: 0Activity Log
Launching program: ' C:\Windows\System32\cscript.exe' 'C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\56\PurgeTempFiles.vbs' wait='true'
Thanks for your help! - abrockhaus 9 years ago -
CScript.exe is actually in C:\Windows\Command, usually. You should be able to just call cscript.exe without using a directory, but if you do fill out the directory field it must be correct. - airwolf 9 years ago
-
I am specifying this for directory $(KACE_SYS_DIR) and cscript.exe does exist in C:\Windows\System32\ - abrockhaus 9 years ago
-
Try without specifying a path for cscript.exe. You're at the mercy of the command line now. You may have to tinker until you find a command that works outside the K1 via command line, and then copy that method into the configuration of the KScript. - airwolf 9 years ago
-
Success, taking out the directory worked! Whew! - abrockhaus 9 years ago
-
Hooray! - airwolf 9 years ago
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.