/build/static/layout/Breadcrumb_cap_w.png

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


0 Comments   [ + ] Show comments

Answers (2)

Answer Summary:
Posted by: airwolf 9 years ago
Red Belt
0

Top Answer

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.

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
Posted by: gerane 9 years ago
Yellow Belt
0
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.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. 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 Privacy Policy and our data protection efforts, please visit GDPR-HQ