it should have quotes before the 'net' and after 'servicename'

<?php
exec("net stop servicename");
?>

also, if php's safe_mode is on, you can only run programs in the safe_mode_exec_dir folder, which would need to be 'C:/WINDOWS/system32' if you are using the net command.

Jayvd wrote:

I'm trying to start and stop a service with PHP.

I've given cmd.exe the right permissions (so IIS can execute etc.) but it still 
doesn't work.

The script I use:
<?php exec(net stop SERVICENAME);
?>

Does anyone know how to solve this problem?


--------------=  Posted using GrabIt  =----------------
------=  Binary Usenet downloading made easy =---------
-=  Get GrabIt for free from http://www.shemes.com/  =-


--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to