Run batch file



  • I am new here but looking to run a simple batch file on my PC using Alexa. I can run the batch file manually on the PC (double click the file name) and it works as expected. I have TRIGGER cmd loaded and running. The example commands (notepad and calculator) work fine from Alexa. But I can't seem to figure out the correct syntax to run the .bat file. Alexa seems to understand the voice name and sends the command to the PC but I am missing something simple


  • administrators

    @ScottC, you probably need to specify the full path to the batch file, like this:

    c:\scripts\batchfilename.bat
    

    You can find the folder the batch file is in by right-clicking the file, and clicking Properties. The Location value is the folder. You can copy/paste that, then add the name of the batch file.

    Or, you could add the folder where you stored the batch file to your PATH environment variable.
    Bubba did a good video on how to do that here: https://www.youtube.com/watch?v=SQKW3BRDBtw



  • @Russ Thanks. That helped. One last question.

    Adding the path to environment variable did help but I had to make the command "start C:\scripts\fix.bat" and then add a line to the batch file for exit to close the CMD window. From the GUI edit window the command worked fine but when I tried to use Alexa it seemed to take the command but did not run the batch file. So added "start" and it worked but left the CMD window open so added last line in batch file as exit and now it runs and closes the CMD window.


  • administrators

    @ScottC, that's interesting. Usually I don't have to add the start prefix, or the exit command to my batch file, but there might be something about your particular batch file that requires those.

    Good job figuring it out.


Log in to reply
 

Looks like your connection to TRIGGERcmd Forum was lost, please wait while we try to reconnect.