Running a batch file is simple enough using the External Program action task in Workflow.
- In the Executable File field, enter: C:\WINDOWS\system32\cmd.exe
- In the Parameters field, enter: /C “C:\BatchFiles\MyBatchFile.bat” (rename file and path accordingly)
- In the Start in field, enter C:\BatchFiles (rename path accordingly)
You should also store the program’s output in a variable or a Job Info and log that output so you can check the logs for the result of the operation after it has run in service mode.
That’s pretty much it. In service mode, the batch file will run using the service’s credentials, so make sure those credentials allow the batch file to perform whatever tasks it needs to do.