TRIGGERcmd
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    TriggerCmd installed as normal, but not running my commands

    General Discussion
    2
    2
    107
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Matheus de SouzaM
      Matheus de Souza
      last edited by

      I'm trying to make the commands work, but it's not working at all.
      When I go to my account, and click to view runs, it shows this error: "Command ran with error code 1"

      39a45852-b655-4820-b32f-862522b63244-image.png

      Anyone know how to fix it?

      Thanks!

      RussR 1 Reply Last reply Reply Quote 0
      • RussR
        Russ @Matheus de Souza
        last edited by

        @Matheus-de-Souza, it's showing "Command ran with error code 1" because your command is failing. Commands return error code 0 when they succeed.

        To troubleshoot, it would help to get the output of your command. You should be able to see the error if you run it manually from a cmd prompt.

        To open a cmd prompt, you can hold the Windows key and press R, then type cmd and press enter.
        9a53f208-d7ed-45ee-b14b-dec1f499230d-image.png

        If the command runs fine in the cmd prompt but it fails when you run it with the TRIGGERcmd agent, you should copy/paste your command into a .bat file and redirect the command's output to a log file, and change your triggercmd command to run the .bat file. That way you can look in the log file to see the error.

        For example, you could create a script.bat file with these contents:

        yourcommand > c:\logs\script.log 2>&1
        

        This part is to make stderr output go into your log, not just stdout: 2>&1

        Notice I put the log file in a c:\logs directory. You'll need to create that directory first. Windows won't let you write to a file in c:\ by default.

        Russell VanderMey

        1 Reply Last reply Reply Quote 0
        • First post
          Last post