Jump to content

can I start and stop services?


flemingmike

Recommended Posts

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.