How to remotely shutdown or reboot Windows 7

Foreword: sorry for the italian language in the screenshot. I don't have an english language pack, and I didn't wanted to steal images taken by others on the internet.

Suppose you already found out how to enable RDP to Windows 7 (professional, in my case). You successfully log in, install a program, and you have to restart the OS to apply this changes. Unfortunately, the program doesn't say:"You need torestart in order to apply the change".
So, as usual, you go to Start, click on the arrow to open the menu, and what you find? This:

Translated: Log Off or Block
WTF?? Where's Shutdown? Or Restart?This is unexpected. Then I realized that maybe it was disabled for licensing reason (or better, security!), in a desktop edition. Well, no. It seems to be just another of the stupid Microsoft things you sometimes find around. Why?

Because there are about 4 other ways to restart (or shutdown) remotely Windows 7. Let's start with the easiest (once you know).

Warning: when you shut down, be sure it is what you want. Also, be sure that you have a way to turn on the PC, in case you, or another user, need it.

1. Windows Security
Translated: Windows Security
Click on Windows Security. The screen that will show up is like the one when you press Ctrl+Alt+Canc:

Translated, from up to down: Lock, Log Off, Change a password..., Start Task Manager, Cancel
WHOA!!! The shutdown button!! And it has Shutdown, Hibernate and Restart option!!! We made it!!

2. CTRL+ALT+END
If you press the keys CTRL+ALT+END you end up with the same screen as windows security.

Warning: one could say: "But that is the CTRL+ALT+CANC screen! Why can't I use it?" Well, because that key combination is captured by YOUR pc, not the remote one. So, you end up with the same screen, but it isn't the one you want.

3. ALT+F4 on the Desktop
Another option, which brings up a different window, is to click on the Desktop, then press ALT+F4. This is the window:
Translated: End of work session
And again, from this drop-down list you have both Restart and Shutdown option.

4. Command Line
If you're scared about command line, type the following command in the Search Box in the Start Menu to restart:
shutdown /r /t 0
shutdown is the command, /r is the restart option, /t is the delay option (in seconds). If you put 0, it will immediatly restart.

To shutdown:
shutdown /s
FOR MORE TECHNICAL PEOPLE: the same works from the command line (cmd.exe)

5. Batch Files
As an extreme measure (in my opinion failry useless unless for automaed jobs, for there are other simpler built-in commands), you can create two batch files.
Conclusion
I still don't understand why to remove shutdown and restart from their default location. Sometimes I think Microsoft simply wants to make life (read: work) harder for everyone that uses it. Bah.

References
http://www.fixedbyvonnie.com/ - an interesting overview of the various methods to shutdown/restart
Microsoft Technet Forum Thread - An answer to an user with the same problem. In the answers there are a couple of interesting suggestions

Labels: