Kaseya Community

Execute Batch File through Procedure

This question is not answered

Hello All,

I am trying to execute a batch file from an agent procedure but am not having any lucky. I have read through a handful of topics that are very similar to mine and have tried some of the suggestions and still no luck.

.Bat contents:

afuwin238 e7990iz1.2p5 /p /b /n /r /reboot

I have also tried running the above in Execute Shell Command but no luck there either.

Please let me know if you would need any other information.

Thanks,

Eric

All Replies
  • Hey Eric,

    bat file not running directly from procedure first you need to copy on machine and after that batch file call with help of procedure.

    upload file on kaseya managed file.

    then write file procedure and then execute the shell command and call that batch file.

    If you have any question please let me know

  • You seem to specify a machine name and various switch options .. but whats the actual command you are trying to run .. it seems to be missing from your batch file ?

  • Hey, there are a few things that you can try here:

    Have you looked in the agent procedure log to check why it's  failing?

    Is afuwin238 in the directory that this command is running from?

    Secondly what does that application need to run as? Are you running as user or as system? If you're running as user should it be the user that's currently logged in or the user that you've set the agent credential as in kaseya?

    So..

    First, make sure you copy the afuwin application to the endpoint

    Then, edit your shell command to call afuwin238 directly from the location, you can do something like this:

    get kaseya working directory as variable "workdir"

    copy fhe afuwin to #workdir#\afuwin238

    edit your shell command so it begins with #workdir#\afuwin238

    try changing it around to run as system or run as user, try adding 'use agent credential' to the top of the procedure and running it as user to give it three different ways to run.

    Hope that helps.

    Phil.