This is pretty simple, but use it with caution, because I have not tested this. If it works as well as I think it will, you might have a very angry victim.
There are only a couple steps to do this. First you must create a shortcut. Just right-click on your desktop, and go to New - Shortcut. It will bring up a dialog box, asking you to "Type the location of the item." You have a couple options. You can make it shutdown or restart, but I would guess the latter is more effective. There are a number of reasons for computers to spontaneously restart, but not many for it to shut down. If you like the restart idea, type "SHUTDOWN.exe -r -t 01" (again, no quotes.) To make it shut down instead, type "SHUTDOWN.exe -s -t 01". This sets the parameters for your command. Shutdown.exe is the program that runs, and to it -r means restart, and -s means shut down. -t sets a time delay, and 01 is the numerical value, in seconds, of that delay. Click next - you can name the shortcut whatever you like, but naming it something like "syscommand32" will probably discourage someone from deleting it, if they can even find it.
Now that your shortcut is ready, just drag and drop it into your start menu startup folder. This will run the program automatically every time the computer boots, and will be annoying to say the least. Use it wisely.
Update: I finally managed to work up the nerve to try it. Safe mode circumvents the automatic execution of the program, but it does not remove the shortcut. Booting into safe mode will prevent it one time, but the next time they restart, the shortcut will immediately activate once again. For the knowledgeable, this presents a pretty small challenge, but for others, this is foolproof fun.