TinyTask Command Line: Run Macros from CMD, Batch Files, and Scripts

Table of Contents

  1. Does TinyTask Have a Command Line Interface?
  2. Step 1: Compile Your Macro to EXE
  3. Running Compiled Macros from CMD
  4. Creating Batch Files for TinyTask Macros
  5. Chaining Multiple Macros
  6. Scheduling Macros with Task Scheduler
  7. Running Macros from PowerShell
  8. Real-World Command Line Workflows
  9. Troubleshooting Command Line Execution
  10. Frequently Asked Questions

1. Does TinyTask Have a Command Line Interface?

TinyTask does not have a built-in CLI with flags and arguments. You cannot pass parameters like tinytask.exe --play macro.rec --loop 5 --speed 2x the way you might with AutoHotkey or other scripting tools. TinyTask is a GUI application designed for point-and-click simplicity.

However, TinyTask has a feature that makes command line usage possible: compiling macros to standalone .exe files. A compiled macro is a self-contained executable that runs the recorded sequence when launched. Since it is an .exe, you can call it from the command prompt, batch files, PowerShell scripts, and Windows Task Scheduler.

2. Step 1: Compile Your Macro to EXE

Before you can run a TinyTask macro from the command line, you need to compile it into an executable file. This is a required step — .rec files cannot be run from CMD directly.

1

Record or Load Your Macro

Open TinyTask and either record a new macro or load an existing .rec file (File > Open).

2

Set Playback Options

Before compiling, configure the playback speed and loop settings. Right-click the toolbar to enable or disable “Continuous Playback.” These settings get baked into the compiled .exe.

3

Compile to EXE

Go to File > Compile (or click the Compile button on the toolbar). Choose a save location and filename. TinyTask creates a standalone .exe file that contains your recorded macro.

4

Test the EXE

Double-click the compiled .exe to make sure it plays back correctly. The macro should run exactly as it did in TinyTask. If it works, you are ready to use it from the command line.

Continuous playback in compiled macros: If you compile with “Continuous Playback” enabled, the .exe will loop indefinitely when launched. You will need to kill the process (Ctrl+Shift+Alt+P or via Task Manager) to stop it. For command line use, you usually want a single-run macro unless you have a separate mechanism to terminate it.

3. Running Compiled Macros from CMD

Once compiled, your macro is just an .exe file. Open Command Prompt and run it like any other program.

Basic execution

C:\Macros\my-macro.exe

This launches the macro and returns control to the command prompt after the process starts. The macro runs in the background.

Using START for non-blocking execution

start "" "C:\Macros\my-macro.exe"

The start command launches the .exe in a separate process. The command prompt does not wait for the macro to finish before accepting the next command. Useful in batch files where you want to continue processing while the macro runs.

Using START /WAIT for blocking execution

start /wait "" "C:\Macros\my-macro.exe"

The /wait flag tells the command prompt to wait until the macro finishes before continuing. This is important in batch files where the next command depends on the macro completing first.

Running from a different directory

cd C:\Macros
my-macro.exe

Or use the full path without changing directories. Always use quotes around paths with spaces:

"C:\Users\John Smith\Macros\daily report.exe"

4. Creating Batch Files for TinyTask Macros

Batch files (.bat) let you automate the launch of your compiled macros with additional logic like delays, conditions, and sequencing.

Basic batch file

Create a text file called run-macro.bat with:

@echo off
echo Starting macro...
start /wait "" "C:\Macros\my-macro.exe"
echo Macro finished.
pause

Double-click the .bat file to run the macro. The window shows status messages and waits for you to press a key before closing.

Batch file with delay

@echo off
echo Waiting 10 seconds before starting...
timeout /t 10 /nobreak >nul
echo Starting macro now.
start /wait "" "C:\Macros\my-macro.exe"
echo Done.

The timeout command pauses for a specified number of seconds. Use this when you need time to position a window or load an application before the macro starts clicking.

Batch file with loop

@echo off
echo Running macro 5 times...
for /L %%i in (1,1,5) do (
    echo Run %%i of 5
    start /wait "" "C:\Macros\my-macro.exe"
    timeout /t 3 /nobreak >nul
)
echo All runs complete.

This runs the macro 5 times with a 3-second pause between each run. Adjust the numbers in (1,1,5) — the third number is the total count. The timeout between runs gives applications time to reset to a clean state.

5. Chaining Multiple Macros

Sometimes a workflow requires multiple macros to run in sequence. Compile each step as a separate .exe, then chain them in a batch file.

@echo off
echo Step 1: Opening application...
start /wait "" "C:\Macros\step1-open-app.exe"
timeout /t 5 /nobreak >nul

echo Step 2: Filling the form...
start /wait "" "C:\Macros\step2-fill-form.exe"
timeout /t 2 /nobreak >nul

echo Step 3: Submitting and saving...
start /wait "" "C:\Macros\step3-submit.exe"
timeout /t 2 /nobreak >nul

echo Step 4: Closing application...
start /wait "" "C:\Macros\step4-close.exe"

echo Workflow complete.

Why chain macros instead of one long recording?

  • Modularity: Fix or re-record one step without redoing the entire workflow.
  • Timing control: Add custom delays between steps using timeout.
  • Conditional logic: Use if exist or if errorlevel to skip steps based on conditions.
  • Reusability: Use step1-open-app.exe in multiple workflows.

Conditional execution

@echo off
if exist "C:\Reports\daily.xlsx" (
    echo Report exists. Running update macro...
    start /wait "" "C:\Macros\update-report.exe"
) else (
    echo Report not found. Running create macro...
    start /wait "" "C:\Macros\create-report.exe"
)

This checks if a file exists before deciding which macro to run. Useful when the workflow depends on whether a previous step has already completed.

6. Scheduling Macros with Task Scheduler

Windows Task Scheduler can run your compiled macros at specific times without any human interaction. This is the closest TinyTask gets to true unattended automation.

1

Open Task Scheduler

Press Win+S and search for “Task Scheduler.” Click “Create Basic Task” in the right panel.

2

Name and describe the task

Give it a descriptive name like “Daily Report Macro” and an optional description.

3

Set the trigger

Choose when to run: Daily, Weekly, Monthly, At startup, At log on, or When a specific event is logged.

4

Set the action

Choose “Start a program.” Browse to your compiled .exe file or your batch file. If using a batch file, set the program to cmd.exe and add /c "C:\Macros\run-macro.bat" as arguments.

5

Configure conditions

On the Conditions tab, uncheck “Start the task only if the computer is on AC power” if you want it to run on battery. Check “Wake the computer to run this task” if the machine might be sleeping.

7. Running Macros from PowerShell

PowerShell offers more control than CMD for launching and managing macro processes.

Basic execution

# Run macro and wait for completion
Start-Process -FilePath "C:\Macros\my-macro.exe" -Wait

# Run macro without waiting
Start-Process -FilePath "C:\Macros\my-macro.exe"

Run with timeout (kill if it takes too long)

# Start the macro
$proc = Start-Process -FilePath "C:\Macros\my-macro.exe" -PassThru

# Wait up to 60 seconds
$finished = $proc.WaitForExit(60000)

# Kill if still running
if (-not $finished) {
    $proc | Stop-Process -Force
    Write-Host "Macro timed out and was terminated."
} else {
    Write-Host "Macro completed successfully."
}

This is useful for continuous-loop macros that need to run for a set duration and then stop. The timeout is in milliseconds (60000 = 60 seconds).

Run macro and log output

$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
$logFile = "C:\Macros\log.txt"

Add-Content $logFile "$timestamp - Starting macro"
$proc = Start-Process -FilePath "C:\Macros\my-macro.exe" -PassThru -Wait
Add-Content $logFile "$timestamp - Macro finished (Exit code: $($proc.ExitCode))"

Loop with custom intervals

for ($i = 1; $i -le 10; $i++) {
    Write-Host "Run $i of 10"
    Start-Process -FilePath "C:\Macros\my-macro.exe" -Wait
    Start-Sleep -Seconds 5
}
Write-Host "All runs complete."

8. Real-World Command Line Workflows

Daily Report Generation

Batch file runs at 8 AM via Task Scheduler. Opens the reporting app, clicks through the report wizard, exports to PDF, and emails the file. Chain of 4 compiled macros with 5-second delays.

Database Backup Trigger

PowerShell script runs a macro that clicks “Export” in a database GUI, waits for the export dialog, selects the save path, and clicks OK. Scheduled weekly with a 2-minute timeout guard.

Game AFK Farming

Batch file starts a clicking macro, runs it for 30 minutes using PowerShell timeout, then kills the process. Loop the batch file in Task Scheduler every hour for hands-free farming sessions.

Related Articles

Timesheet Auto-Fill

A Friday afternoon batch file opens the timesheet web page, runs a form-filling macro for standard entries, pauses for manual review, then runs a submission macro. One double-click handles the whole thing.

9. Troubleshooting Command Line Execution

Macro runs but clicks in wrong positions

Screen resolution or DPI scaling changed since the macro was recorded. Compiled macros use absolute pixel coordinates. If you moved to a different monitor or changed display settings, re-record and recompile the macro at the current resolution.

Batch file closes immediately without running

The path to the .exe is wrong or has unescaped spaces. Always wrap paths in double quotes: "C:\My Macros\daily report.exe". Add pause at the end of the batch file to see error messages before the window closes.

Task Scheduler runs the macro but nothing happens

The task is running in a background session where no desktop is visible. TinyTask macros need an active, unlocked desktop. Make sure the user is logged in, not locked, and the task is configured to “Run only when user is logged on” (not “Run whether user is logged on or not”).

Macro starts but the target application is not ready

Add a timeout /t 10 delay in the batch file before starting the macro. If launching an application first, use start /wait to let it fully load before the macro begins clicking.

Compiled EXE is flagged by antivirus

TinyTask compiled .exe files simulate keyboard and mouse input, which some antivirus programs flag as potentially unwanted. Add an exception for the .exe file or the folder containing your macros in your antivirus settings.

Cannot stop a looping macro launched from CMD

Press Ctrl+Shift+Alt+P (TinyTask’s stop hotkey) or open Task Manager (Ctrl+Shift+Esc), find the macro process, and click “End Task.” For PowerShell, use the timeout-and-kill pattern shown in section 7.

10. Frequently Asked Questions

Can I pass arguments to a TinyTask macro from the command line?

No. TinyTask compiled .exe files do not accept command-line arguments. You cannot pass parameters like click positions, loop counts, or speed settings. The macro replays exactly as it was recorded and compiled, with all settings locked in at compile time.

If you need parameterized macros, consider AutoHotkey. AHK scripts can read command-line arguments using the built-in A_Args array, allowing you to pass different values, file paths, or loop counts each time you run the script from CMD or a batch file.

Can I run a .rec file directly from the command line?

No. The .rec file format is a binary recording that only TinyTask’s GUI can play back. The command line cannot execute .rec files directly. You must compile the .rec file into a standalone .exe using TinyTask’s Compile feature (File > Compile) before you can run it from CMD, batch files, or PowerShell.

Think of the .rec file as the source and the .exe as the compiled output. Keep both: the .rec file in case you need to modify the macro, and the .exe for command-line execution.

How do I stop a compiled macro that is running in a loop?

There are three ways to stop a looping compiled macro. First, press Ctrl+Shift+Alt+P, which is TinyTask’s built-in stop hotkey that works even with compiled .exe files. Second, open Task Manager (Ctrl+Shift+Esc), find the process in the list, and click “End Task.” Third, if you launched it from PowerShell, use the Stop-Process cmdlet to kill it programmatically.

For batch file automation, the PowerShell timeout pattern is the cleanest approach: start the process, wait for a set duration, then forcefully stop it. This gives you precise control over how long the macro runs.

Will compiled macros work on other computers?

Compiled .exe files are self-contained and do not require TinyTask to be installed on the target computer. You can copy the .exe to any Windows machine and run it. However, the macro records absolute screen coordinates, mouse movements, and keyboard input. If the target computer has a different screen resolution, DPI scaling, or application layout, the clicks will land in the wrong positions.

For best results, compile and test on the machine where the macro will be used. If you need to transfer macros between computers with the same setup, make sure both machines use identical resolution and DPI settings.

Can I control the playback speed from the command line?

No. The playback speed is set during compilation and cannot be changed at runtime. If you need the same macro at different speeds, compile separate .exe files: one at 1x speed, one at 2x, and so on. Name them descriptively like report-1x.exe and report-2x.exe, then reference the appropriate one in your batch file or script.

This is one of TinyTask’s limitations. Tools like AutoHotkey allow you to set delays dynamically via command-line arguments, giving you runtime speed control that TinyTask lacks.

Can I run macros from Python or other programming languages?

Yes. Any programming language that can launch external processes can run compiled TinyTask macros. In Python, use the subprocess module:

import subprocess
subprocess.run(["C:\\Macros\\my-macro.exe"])

In Node.js, use child_process.execFile(). In C#, use Process.Start(). The compiled .exe is just a regular Windows executable, so it works with any language’s process execution capabilities.

How large are compiled TinyTask .exe files?

Compiled .exe files are very small, typically between 50 KB and 200 KB depending on the length of the recorded macro. A simple click-and-type macro compiles to around 60-80 KB. Longer macros with many mouse movements produce slightly larger files because the movement data takes more space.

These file sizes are negligible by modern standards. You can store hundreds of compiled macros without worrying about disk space, and they transfer quickly over networks or email.

Can I use TinyTask macros in a CI/CD pipeline?

TinyTask macros require an active desktop session with a visible screen. Most CI/CD runners (GitHub Actions, Jenkins agents, Azure Pipelines) run as headless services without a GUI. TinyTask macros will fail in these environments because there is no screen to interact with.

For CI/CD automation, use tools designed for headless operation: Selenium for web testing, AutoIt for Windows GUI testing in RDP sessions, or PowerShell scripts for non-GUI tasks. TinyTask is best suited for personal desktop automation, not server-side pipelines.

Is there a way to run TinyTask silently (no window)?

Compiled TinyTask macros already run with minimal UI. There is no visible TinyTask window during playback of a compiled .exe. The macro simply simulates mouse and keyboard input in the background. The only visible activity is the mouse moving and clicking on screen, which is unavoidable since the macro interacts with the actual screen.

If you want to suppress the command prompt window when launching from a batch file, use start /min "" instead of start "" to minimize the CMD window. Or create a VBScript wrapper that launches the .exe without any visible console window.

What happens if I compile a macro with Continuous Playback enabled?

The compiled .exe will loop the macro indefinitely. It starts playing, reaches the end, and immediately starts over. This continues until you manually stop it using the stop hotkey (Ctrl+Shift+Alt+P), kill the process via Task Manager, or use PowerShell’s Stop-Process command.

For command-line use, this is usually not what you want unless you pair it with a timeout. The PowerShell pattern from section 7 (start the process, wait for N seconds, then kill it) is the standard approach for running looping macros for a controlled duration from scripts.

Download TinyTask and Start Scripting

Record macros, compile to EXE, and run them from the command line. Free, portable, 36 KB.

Download TinyTask