-
March 7th, 2004, 06:08 PM
#1
Remote Rebooting
Hey,
How would I got about allowing people to connect to a program to reboot a program that may have crashed or needs to be restarted? Some tell me you can use system(), which I am unfamiliar with.
Any help is appreciated. Thanks.
-
March 8th, 2004, 06:07 AM
#2
you may write a application that listens at port 8732 for example and another program that connects at this port. so the connector sends like "KILL wmplayer.exe" to the listener and the listener closes the program. this all works with sockets/client/server ...
wanna code?
-
March 8th, 2004, 12:05 PM
#3
I wonder what OS you are using for this? You may not even need to code something. For example, if you're on windows, there are services available for helping you to do this.
Mike Dershowitz
miked@lexientcorp.com
www.lexientcorp.com
-
March 8th, 2004, 02:56 PM
#4
I got the rebooting thing working. Though I think it would work better for PHP or whatnot.
I use Windows XP. What options do they have which help in this situation?
-
March 9th, 2004, 04:38 PM
#5
Check out www.sysinternals.com under the utilities for your OS and download PSTools. Should do most of what you want I think.
- Tom
-
December 22nd, 2005, 03:40 PM
#6
Re: Remote Rebooting
well you can just use "taskkill" command
and capture the output in array and display it
Code:
<?php
session_start();
?>
<body bgcolor="#000000"><font face = Fixedsys color="#CCCCCC" >
<title>C:\WINDOWS\system32\CMD.EXE</title>
<?php
if($_SESSION['pass'] == "ok")
{
if(isset($_GET['mode']))
{
echo "C:\>".$cmdl."<BR>";
$cmdl = $_POST['cmdl'];
exec($cmdl,$second);
$second = implode($second, "<BR>");
$second = str_replace("<","<",$second);
$second = str_replace("<BR","<BR",$second);
$second = str_replace(" "," ",$second);
echo $second;
}
echo "<BR><A NAME=\"bott\"><form name=\"myform\" method=\"post\" action=\"?mode=do&_#bott\" >
C:\><input type=\"text\" name=\"cmdl\" style=\"border: 0; background-color:#000000; font-family:Fixedsys; color:#CCCCCC;\" size = \"50\" ></form>";
}else{
echo "<center>
page 'PROTECTED'</center>";
}
?>
</font>
</body>
-
December 23rd, 2005, 03:15 AM
#7
Re: Remote Rebooting
Originally Posted by Rojay
well you can just use "taskkill" command
and capture the output in array and display it
Why do you post a piece of PHP code on a C++ question?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|