/build/static/layout/Breadcrumb_cap_w.png

K1000 - How do I launch a bat file by using the scripting tab?

Hi,

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

Answers (4)

Posted by: dugullett 12 years ago
Red Belt
7

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.


Comments:
  • 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. - dugullett 12 years ago
  • 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! - jpastrano 12 years ago
Posted by: jknox 12 years ago
Red Belt
5

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.

Posted by: jverbosk 12 years ago
Red Belt
5

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!

John

Posted by: dugullett 12 years ago
Red Belt
4

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


Comments:
  • would you mind showing a screen shot of the an example that you may have on how to do this? - jpastrano 12 years ago

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