Running iMacro with PHP

I’m trying to run an iMacro in Firefox on Windows with a PHP script. Here is the code, but nothing appears to happen when it runs.

[php]<?php

exec(’“C:\Program Files (x86)\Mozilla Firefox\firefox.exe” imacros://run/?m=block.iim’);

?>[/php]

The iMacro runs when I type "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" imacros://run/?m=block.iim into the command prompt or run a batch file with that. I’m new to PHP and maybe I misunderstand how the exec() function works, but I couldn’t figure out what’s going wrong.

Try this

[php]$WshShell = new COM(“WScript.Shell”);
$oExec = $WshShell->Run(’“C:\Program Files (x86)\Mozilla Firefox\firefox.exe” imacros://run/?m=block.iim’, 3, true);[/php]

With external programs I ended up using batch files to execute them.
Within PHP
[php]system(“cmd /c C:[path to file]”);[/php]

Then use the batch file to do the proper load. It may make it easier to do the “imacros://run/?m=block.iim” part.

Sponsor our Newsletter | Privacy Policy | Terms of Service