Run a .BAT (batch) file in RunMacro
RunMacro RunnerRunMacro 3.5+
The Run .BAT File command executes a Windows batch (.bat) file.
Dialog & quick setup

- Add a Code › Run .BAT File command.
- Choose the path to the
.batfile. - Save. On run, it is executed via cmd.
Options reference
Modes & when to use
RunMacro Runner
Best for
- Run an existing .bat to clean up/start a service.
- Call Windows system commands in a workflow.
- Integrate existing command-line tools.
Use an alternative when
- Do not run BAT from an untrusted source or commands requiring a different shell/privilege context.
Before you run
- Add Run .BAT File to the macro.
- Prepare the data or target that Run .BAT File will use.
Example workflow
Common Use Case: Running a Daily System Cleanup Script (.bat)
- Create a
cleanup.batfile (e.g., deleting temporary files in%TEMP%or clearing Downloads) containing maintenance commands likedel /q /f /s "%TEMP%\*". - Add a Code › Run .BAT File command in RunMacro and select the path to your
cleanup.batfile. - Combine with the Scheduler feature in RunMacro Runner to execute the cleanup automatically every day without opening CMD manually.
- Looking to run or schedule batch scripts directly in Windows? Read our complete guide on how to run a .bat file in Windows 10 & 11.
Expected result: After execution, Run .BAT File completes the described action and makes its result available to the next step.
Tips & limitations
Only run .bat files you trust — batch can perform powerful system actions.
- Quoting, working directory, environment variables, and cmd exit codes affect results; scripts can modify the system.
Applies to RunMacro 3.5+ · RunMacro Runner · Windows 10/11
