How it works
- Choose to type cmd commands, or to run a program by its full path or a name found on PATH with arguments, one per line.
- Values from the routine are passed separately and read in commands as !KR_name!, so text such as & or | in a value stays plain text.
- It runs hidden with a time limit and a memory limit, and everything it started is stopped with it when time runs out.
- The outputs include the exit code, the output text, error output, the lines, and parsed JSON when the output is JSON.
- Script steps are off until you turn on Allow script steps under Settings ▸ Advanced, and a dry run skips this step.
Routines that use it
Pull your repos each morning
At a time at 08:45 runs git with pull in your project folder and Script result warns you if it failed.
Run a legacy batch file
A Hotkey runs an old .bat cleanup script and Show banner reports when it finishes.
Network check
When Internet connected or lost fires, Run command runs ipconfig and Write text file saves the output for later.
Settings
| Setting | What it does |
|---|---|
| Mode | Type commands for cmd, or run a program with arguments. |
| Commands | The commands, as in a .cmd file. Values from the routine aren't pasted in here: add them under Values and use !KR_name! (cmd expands that after reading the line, so the value stays text). |
| Program | The program: its full path, or a name on PATH such as git. |
| Arguments | The program's arguments, one per line. Each is passed on its own, never joined into one command line. |
| Values | Values for the commands, by name. The commands read each as !KR_<name>! (for example !KR_folder!). |
| Working folder | The folder it starts in. Empty: your user folder. |
| Timeout | It is stopped, with everything it started, after this long. |
| Fail on erroradvanced | Fail the step when it ends with an exit code other than 0. |
| Memory mb | The most memory it and everything it starts may use together. |
Good to know
- Programs that should keep running after the routine belong in Open app, because a command and everything it starts end with the step.
- Batch files given as programs refuse arguments with cmd's special characters; pass those as values instead.
Questions
- Can I run a .bat file automatically on a schedule?
- Yes. Use At a time or Every … with Run command, either as commands or with the .bat file as the program. Turn on Allow script steps in Settings first.
- Why are values written as !KR_name! and not pasted in?
- Keeping values out of the command text means a value can never turn into an extra command. Cmd reads !KR_name! after it has understood the line, so the value stays plain text.