In Windows XP, when you click on “Turn Off” from the start menu you are shown a confirmation dialog box from which you are able to choose different options like Shutdown, Restart, Hibernate and Standby. The shutdown confirmation box gave you an opportunity to change your mind after you’ve hit the Turn off button. More importantly it prevented accidental shutdown of Windows.
Microsoft removed this vital shutdown box in Windows Vista and Windows 7. I can’t understand why should a potentially data-losing operation like Windows shutdown be allowed to proceed without the mandatory confirmation box. If a user accidentally clicks on the Shutdown button with unsaved documents open, it’s a disaster.
There are two ways to avoid this. The first method involves changing the default behavior of the shutdown button.
To do this, right click on the taskbar and choose Properties. Under the Start Menu tab, change the “Power Button action” to “Switch User”.
This will change the ‘Shutdown Down’ button into a ‘Switch User’ button. So if an accidental click happens to land on the power button, you will be directed to the logoff screen instead of promptly shutting down the computer. This will enable you to stop an unintentional shutdown. The actual shutdown now becomes a two-step process, where you have to click on the small arrow next to the power button and choose "Shutdown” from the fly-out menu.
This is only a workaround. The second method gives you the actual shutdown confirmation dialog box.
There is a software called Shutdown Guard that prevents any applications from shutting down, rebooting or logging off the computer either intentionally or unintentionally without the user’s intervention. The program runs silently in the background and whenever Windows Vista or Windows 7 tries to shutdown, it displays a screen like this.
ShutdownGuard can be used on Windows XP too, but in XP it displays a simple balloon tip.
ShutdownGuard can be enabled and disabled from the system tray. I consider this program extremely important for all Windows 7 and Vista users.