You are here: iOpus > iMacros > Support > IM Tutorial: Command Line Interface 

Tutorial: Batch Files 

Prerequisites:  iMacros Pro or Scripting Edition  

Goal: Automate the IM Web browser with the iMacros Command line interface and batch files.

The iMacros Command Line Interface is an easy way to automate your web browsing tasks. It can be called from batch files, the task scheduler, directly from the Windows run box or from any windows program.
 
echo off
echo Example iMacros Batch File
REM Tip: You may have to adjust the path names to YOUR installation directory of iMacros

REM Note: The "-loop <x> " command runs the macro <x> times in a loop. 
REM This is the same as pressing the LOOP button in the IM browser.

"[programpath]" -macro Demo-FillForm -loop 3

REM The batch variable %errorlevel% is automatically set by "imacros.exe" upon exit

if %errorlevel% == 1 goto ok
if NOT %errorlevel% == 1 goto error

:ok
echo Macro completed succesfully!
goto end

:error
echo Error encountered during replay.
echo Errorcode=%errorlevel% 
echo Please see the user manual for a detailed description of error codes.

:end
pause