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.
Printable View
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.
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? ;)
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.
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?
Check out www.sysinternals.com under the utilities for your OS and download PSTools. Should do most of what you want I think.
- Tom
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>
Why do you post a piece of PHP code on a C++ question? :confused:Quote:
Originally Posted by Rojay