Jump to content

can I start and stop services?


flemingmike

Recommended Posts

I changed the code, it will work, just tried it my self lol.

 

and it crashed all 10 servers  was not funny.

 

my fault.

 

go off in 30 sec, i am using all the short hand exspressions -s example.

 

For more information, see http://www.php.net/function.exec and http://www.ss64.com/nt/shutdown.html.

shit.  when i was testing with a batch file in the root of c that just changed directories, it was working.

 

now i am trying

 

 exec('c:\WINDOWS\system32\cmd.exe /c START D:\Scripts\rh.bat');

 

here is rh.bat

 

cd\

net stop "FireDaemon Service: Helium7"
net start "FireDaemon Service: Helium7"


exit

 

Any ideas why this may not work?

The exec() commands you learn as you go along , there millons off examples on google.

 

Were here to teach you things wrong with your code , but not to write your code and teach you online like a school or collage.

 

 

go here.

 

http://www.php.net

http://www.w3schools.com/php/default.asp

http://www.tizag.com/phpT/

 

 

my code.

 

<?php

/**
* @author john 
* @copyright 2011
*/


if(isset($_POST['submit'])){

exec('shutdown -s -t ' . intval($_POST['shut']) . ($_POST['shut'] ? ' -f' : ''));
}

?>

<center>

<form method="POST" action=" ">

<b>WHEN SHOULD I SHUT DOWN MY PC!</b>

<select name="shut">

<?php

for($i=1; $i<10; $i++){

echo"<option value='$i'>$i<option>";
}

?>

    
</select>

<input type="submit" name="submit" value="Shut me down when!">

</center>

 

I had the inpression, you wanted a code to turn you pc off , not to teach you php like a online school.

 

www.amazon.co.uk

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.