Sometimes, the programs you use to connect to your PC (e.g. TeamViewer) might fail and your computer might need a reboot to start them again. If your Web server running PHP is still up and running and you have a way to create a file on it (some php file editor, ftp etc.), this is what it needs to contain:
<?php exec('shutdown -f -t 0 -r'); ?>
More details about the shutdown command you will find below:
|Shuts down the comptuer.
|Reboots the computer.
|Force-close all running applications.
|Specifies a specific computer on the network that you want to shut down or reboot. Absent this parameter, the command affects only the local PC on which it is run.
|Sets a delay (xx seconds) before the specified operation commences.
|Add your own text inside the quotations to provide remote users with a message about why and when their PC will shut down or reboot.
|Aborts a shutdown or restart if used during the (-t) delay period.
|Hibernates the computer.
|Displays the full help document with all commands.