exec function does not seem to work for me

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
lostconjugate
Forum Newbie
Posts: 5
Joined: Tue Dec 07, 2010 3:14 pm

exec function does not seem to work for me

Post by lostconjugate »

When I try to use the following command

exec('c:\test.bat');

The webpage just hangs, and not because the batch file is still running. Inside the batch file it just says

echo test > test.log
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: exec function does not seem to work for me

Post by Christopher »

Does the webserver have permission to run test.bat?
(#10850)
AdrenalineSeed
Forum Newbie
Posts: 24
Joined: Sat Oct 09, 2010 5:54 pm

Re: exec function does not seem to work for me

Post by AdrenalineSeed »

Good question, I tried putting the batch file in the wwwroot directory where network service has rights. But not sure if this is the account that PHP uses.
AdrenalineSeed
Forum Newbie
Posts: 24
Joined: Sat Oct 09, 2010 5:54 pm

Re: exec function does not seem to work for me

Post by AdrenalineSeed »

bump
Post Reply