Change Shutdown Setting

When doing automated reboots using shutdown.exe in my scripts i sometimes need to change back the default shutdown option so the user will have “Shutdown” as the default selection in the shutdown box.

The shutdown setting determining the default shutdown option – (log off, shutdown, restart, standby, hibernate, disconnect) can be found in the registry under current user settings.

Key: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer
Value: Shutdown Setting
Type: REG_DWORD
Radix: Hex
Data: 00000002

The possible values for Shutdown Setting are:

00000001 = Log Off
00000002 = Shut Down
00000004 = Restart
00000010 = Stand By
00000020 = Stand By (with wakeup events disabled)
00000040 = Hibernate
00000080 = Disconnect (only available in Terminal Services sessions)