Hi all,
I want to do a remote shutdown to PC that is in the same domain as mine. I managed to do a command prompt version and it works but now i need to add it in my application, so i tried converting it to PHP, but i cannot seem to get the result i want. Can anyone tell me what i am doing wrong..
In CMD:
c:\WINDOWS\Power\psshutdown.exe \\172.16.223.213 -u sadmin -p studadmin -f -k -t 1
In PHP:
[PHP]
if (isset($_POST['Rshutdown']) && ($_POST['Rshutdown'] == 'Shutdown'))
{
$ipaddress = (' \\\\' .$_POST['Ripadd']);
$username = (' -u ' .$_POST['Rname']);
$userpw = (' -p ' .$_POST['Rpw']);
$shutdownMins = (' -t ' .$_POST['Rmins']);
$all = (($ipaddress) .($username) .($userpw));
$remoteshutdown = ('c:\windows\power\psshutdown.exe' .($all) .' -f -r' .($shutdownMins));
echo "$remoteshutdown";
$a = shell_exec($remoteshutdown);
}
[/PHP]
Thanks in advance..