I'm trying to launch a .bat file that is located on a network share.  This bat file contains info to launch an installer that's also located on the network share.  Using Scripting, how do I perform this task?  I'm having no luck running via Scripting.  In this script I have set it to Allow Run While logged Off, it's running as an machine admin, not system account.

I have tested the bat file manually and it works.  When I perform a Run Now and glance at the logs I get this error:

I'm sure I'm doing something wrong, but don't know what.  Please help.  Thanks!

0 Comments   [ + ] Show Comments


Please log in to comment

Community Chosen Answer


Sorry for the new answer. I can't post pics in comments. Make sure Windows is selected as the OS. If not you will not get this option.

Answered 09/18/2012 by: dugullett
Red Belt

  • The bad thing about using the verify to run the bat is that it will always run. I would suggest checking for a file or registry under verify. Then if that file does not exist Remediation will call the bat file. This way it only runs if it needs it.
  • Thanks!! This kind of worked for me. It works great when a user is logged on, but doesn't work when a user is not logged on. I enabled debug on that machine and the debug log didn't help me much other than it looks like it should have worked:
    Debug Log
    Kbot Config Info - Start
    id=53 name=adobe test version=1348003026 type=policy
    execute disconnected=false logged_off=true
    execute events
    Kbot Config Info - Finish
    runkbot ----- launching [path='C:\ProgramData\Dell\KACE\\kbots_cache\packages\kbots\53' program='kace5146.bat' parms='' wait='false'] -----
    runkbot ----- completed [exitCode=0] -----

    Have you been able to get bat files to run this way when no user is logged in? We are running win7 x64. I'm using the run as option and selecting a user that has admin rights to the desktop and has rights to access the unc share for the installation. Thanks!
Please log in to comment



I'd upload the adobe.bat as a dependency and call it that way. 

Also, keep in mind, if you allow it to run while logged off, it probably won't have access to the network share.

Answered 09/18/2012 by: jknox
Red Belt

Please log in to comment

On my K1000, there's an example script named "Uninstall Msiexec Template" which has the "Run a batch file" option in the Remediation section.  I have copied this script countless times so I could do as jknox advised - include a Verify step (even if it always fails).  Hopefully you have this example script and can use it as a template as I did (not sure if it's only on older KBOXes or not...). 

Here's a screen just to show you exactly what I mean:

I typically have these set to run as Online KScripts, either with Run As Local System *or* Run As User logged in to console, depending on the target.

Hope that helps!


Answered 09/18/2012 by: jverbosk
Red Belt

Please log in to comment

You can run a batch file under verify and call the other bat file on the network share.

Answered 09/18/2012 by: dugullett
Red Belt

  • would you mind showing a screen shot of the an example that you may have on how to do this?
Please log in to comment
Answer this question or Comment on this question for clarity