3

I'm using a program called Do It Again which is a mouse recorder. I am trying to launch a shortcut to it from my php script. Seems all is okay when I run it as a stand alone program, and is not set to have to be run by the administrator - still when I launch it from my php page I get the windows popup saying the program has crashed. "DoItAgain.exe has encountered a problem and needs to close. We are sorry for the inconvenience."

It's not the program, but something in my code:

$command= 'C:\\xampp\htdocs\poster\dia\\Monty_20.dia';
exec($command);

I also tried the following but get the windows popup error: "The Application Failed to Initiate Properly"

$command= ('START C:\\xampp\\htdocs\\poster\\dia\\Monty_20.dia');

Any help would be greatly appreciated. I've been at it for 3 hours now and I'm pulling out what little hair I have left.

0

1 Answer 1

1

Try copying your command to the clipboard. Press Windows-R to get a run dialog, where you paste it and click Run. If you get the same error, the problem is PHP related or permission related.

The more likely case is the program just isn't working. In that case someone who has experience with Do It Again could be more helpful. (Their forum, perhaps?)


Based on the exec docs, it may help to redirect output.

If a program is started with this function, in order for it to continue running in the background, the output of the program must be redirected to a file or another output stream. Failing to do so will cause PHP to hang until the execution of the program ends.

So your command would need to redirect the output to the null device. I don't use windows but I believe it would be something like C:\path\to\my.exe > NUL.

Sign up to request clarification or add additional context in comments.

1 Comment

Tried the run and it works perfectly. I've tried changing the shortcut used in the code to ones from other programs (not the exe's but the shortcut) and it crashes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.