Kaseya Community

Why does execute shell command not work?

  • I'm trying to create an extremely simple procedure to run a .bat file which works when I run it locally but not through a procedure.  The bat file even executes if I use command prompt though Live Connect.

    [edited by: andrewf at 11:48 AM (GMT -7) on Apr 15, 2013] screenshot
  • If I could even use a second command instead of the batch file such as "nvspbind -d * kl_klim6" which uses the nvspbind executable already located in the temp folder that would be great too.  But neither options work through a procedure.

  • Are you testing for the existence of the file prior to proceeding?

    Are you writing the batch file prior to execution, or is this a static file that can never be deleted?

    Try to run 'executefile' against the batch file instead of using executeshellcommand. In the interim, I'll see if I can test that as well.

  • Honestly I was using the batch file simply because the shell command feature won't work for me.  All the batch file contains is the command "nvspbind -d * kl_klim6" with an echo to create a log file to see if the procedure actually ran the batch file, which it hasn't.  I did try execute file on the batch file and that didn't work either.

    Really my goal is to use command shell for two commands:

    cd C:\temp

    nvspbind -d * kl_klim6

    nvspbind is an executable that is already stored in the C:/temp folder which unbinds a driver from all network adapters.

  • I think execute shell command will run each of the steps independently of each other.

    Try just writing one step that says C:\temp\nvspdind -d * kl_klim6

    However i've also been having trouble with this step lately

  • Does the procedure fail or report success, and simply not perform the command? I have plenty of procedures that execute commands similar to yours, but none with an asterisk. I'm concerned that the asterisk may be causing the issue with Kaseya.

  • No luck with that either Elliot.

    Matt:  The procedure is just not running. It sits at next exec time.  Whether I use the direct nvspbind command or the bat file.  The bat file would eliminate you concern with the asterisk I think.

    [edited by: andrewf at 12:40 PM (GMT -7) on Apr 15, 2013] edit
  • Insert a new step 2

    sendMessage("nvspdind -d * kl_klim6"), "Display Now", "All Operating Systems", "Halt on Fail")

    Then, make sure that the command as desired, including the asterisk, is shown perfectly on the desktop screen.

  • I just made a procedure with sendMessage as the only step.  The procedure ran but no message displayed.

    [edited by: andrewf at 12:52 PM (GMT -7) on Apr 15, 2013] correction again
  • Actually I'm sorry I see the message. And yes it shows properly with the asterisk.

  • Just figured it out... It was the quotes and using two steps.  I followed Elliot's suggestion by using C:\temp\nvspbind -d * kl_klim6 as a single step without quotes and that worked.  So silly

  • Maybe you can help me with my problem. Trying to execute this command but doesnt seem to be working.

    wusa /uninstall /kb:2718695 /quiet /norestart

    I tried executing as system and as user. I never use the execute as 64 bit shell. Should i use that?

  • I created an identical procedure for that just last Friday.

    wusa.exe /uninstall /kb:2823324 /norestart /quiet

    You're missing the .exe

  • Why you need to use .exe for wusa is a mystery to me but I found the command online somewhere.

  • On my computer it worked without the .exe but ill try the script with it and see how that goes.