Link to home
Start Free TrialLog in
Avatar of dhavalbsolanki
dhavalbsolankiFlag for India

asked on

How Can I execute Exe FIle Using PHP In Windows XP

HI Everyone,
I am using WAMP. I want to Run An Exe File Which is Printing the document using PHP.
I have Used  exec("file.exe")
 but my browser got Hanged . No output given

Thanks
Avatar of Richard Quadling
Richard Quadling
Flag of United Kingdom of Great Britain and Northern Ireland image

The exec() command is taking place on the web server. Most likely, your web server service is set to NOT interact with the desktop.

So, PHP launches file.exe on the web server and doesn't show anything.

PHP is waiting for the application to finish before continuing itself.

The browser is way down the list of important things at this time.

So. Did you intend to execute file.exe on the web server (Oh - if you have access to the web server, take a look at the task manager to see if file.exe is running - once, twice, many many times?).

You can change the "Interact with the desktop" setting on the web server service.

If file.exe is expecting to interact with resources which are NOT on the local machine (file stores, remote printers, etc.) then localsystem will not be enough. You may need to change the user dealing with the web server service.

Erm..

See if anything above makes sense and come back if you have more questions.
<?php
exec ("del c:\\folder\\file.txt");
?>

i love exec :)
ASKER CERTIFIED SOLUTION
Avatar of Richard Quadling
Richard Quadling
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dhavalbsolanki

ASKER

Thanks for your comment I appreciate it