/build/static/layout/Breadcrumb_cap_w.png

Kace K1000 - How Do You Run a VBScript File?

I've completely given up on this.  I used to use Altiris and it was so easy to add your own scripts.  I cannot for the life of me figure out how to run exisiting VBScript files in Kace.  Does anyone know this is done? 

When I go to "Offline KScripts", i don't see how you can attach the vbscript file.

 

Thanks in advace.


1 Comment   [ + ] Show comment
  • When I launch the program with these setting I'm getting a script failure with the log file showing file does not exist for the path. I've double-checked the path and my spelling and the file does exist. Anyone else have this issue? - jmmctighe 9 years ago

Answers (3)

Answer Summary:
Posted by: dugullett 11 years ago
Red Belt
5

Upload the vbs as a dependency.

Launch a program:
Directory: $(KACE_SYS_DIR)

File: cscript.exe

Parameters: $(KACE_DEPENDENCY_DIR)\yourscript.vbs

Comments:
  • Is that's how it's done? wow, I would have never figured that out. I'll give this a shot Thanks - InterneToughGuy 11 years ago
    • If you click the yellow "?" next to "Policy or Job Rules" it will explain a little better on what those variables mean. - dugullett 11 years ago
  • Thanks again, just started using KBox several weeks ago. I think you've steered me in the right direction to get this working.

    The VBS file I want to run is using UNC path to copy a folder to the %appdata% folder. Is there a way copy what I need locally directly from the Kbox? - InterneToughGuy 11 years ago
    • There's about 10 different ways to do everything in Kace. It's really just personal preference. If I'm understanding what you are doing correctly I would follow these steps.

      Upload the dependency.

      Verify: The file exists in %appdata% (This will cause the script to not be run over and over)

      Remediation: Launch a program and run your vbs.
      I'm not sure what else your script is doing, but you can run a batch script here and copy
      \\server\share\file.txt %appdata%.

      Remediation Success and Failure: Log the outcome. - dugullett 11 years ago
      • You can also check these out for additional training. Not sure if you've done jumpstart yet or not.
        http://www.kace.com/support/resources/kb/article/KACE-Kontinuing-Education-K1000-and-K2000-Recordings - dugullett 11 years ago
      • Yes KACE's complexity is one of the things that makes it great. - RandomITPro 11 years ago
  • Kace's has compromised quality and is difficult and frustrating for IT administrators to use. Not being able to run Powershell/VBscripts without popping up a black box is just not acceptable. I'd rather configure workstations using native tool such as powershell/vbscript, Scheduled tasks and Group Policy. K1000 just isn't the right tool to be configuring desktops using scripts. - Geedoubleu 11 years ago
  • @dugullett I have setup the Online Kscript and run as logged in users as you mentioned above and edited the script to work for us as you mentioned here: http://www.itninja.com/question/installing-printers-drivers

    ON ERROR RESUME NEXT
    Set wshNet = CreateObject("WScript.Network")
    Set wshPrn = wshNet.EnumPrinterConnections
    For x = 0 To wshPrn.Count - 1 Step 2
    If Left(wshPrn.Item(x+1),2) = "\\" Then wshNet.RemovePrinterConnection wshPrn.Item(x+1),True,True
    Next

    wshnet.AddWindowsPrinterConnection "\\prtsrv201\OCE2075-001"
    wshnet.AddWindowsPrinterConnection "\\prtsrv201\AROCE2075-001"
    wshnet.SetDefaultPrinter "\\prtsrv201\OCE2075-001"

    I see the command window open on the target machine as if it is running, but nothing happens. All the drivers are on the print server for all our printers.

    I uploaded the dependency .VBS file and set the following:

    I ran the Policy Task as Success using"

    Launch a program:

    Directory: $(KACE_SYS_DIR)

    File: cscript.exe

    Parameters: $(KACE_DEPENDENCY_DIR)\PrinterInstallScript.vbs


    I am not sure what I am missing. Logs shows this:

    For our XP Machine:
    Log for Printer Install on LabSC111-028[ Show All ]
    Started: 01/15/2014 08:33:19
    Finished: 01/15/2014 08:33:19
    Elapsed Time: 0 second
    Status: 1
    Output Log
    Running as: SYSTEM
    Launched Process: cscript.exe
    Activity Log
    Launching program: 'C:\WINDOWS\System32\cscript.exe' 'C:\Documents and Settings\All Users\Dell\KACE\kbots_cache\packages\kbots\121\PrinterInstallScript.vbs' wait='false'

    For our Windows 7 Machine:

    Log for Printer Install on Lab01-PC[ Show All ]
    Started: 01/15/2014 08:33:19
    Finished: 01/15/2014 08:33:19
    Elapsed Time: 0 second
    Status: 1
    Output Log
    Running as: SYSTEM
    Launched Process: cscript.exe
    Activity Log
    Launching program: 'C:\Windows\System32\cscript.exe' 'C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\121\PrinterInstallScript.vbs' wait='false' - akilpatrick 10 years ago
Posted by: SMal.tmcc 5 years ago
Red Belt
1

I have been using this method for years and it works with win 7 8 10.


Posted by: Goggeh 5 years ago
Orange Belt
0

In case anyone else struggles with this on Windows 10 machines:


I spent lots of time trying to get it to work using the launch a program method but it just didn't work but I couldn't see why.


I finally had success by running it as an "Online Shell Script", having the script as a dependency and in the script having one line:


%SystemRoot%\System32\cscript.exe scriptname.vbs


This ran the script correctly and captured the output in the log.

 
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