• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1085
  • Last Modified:

Windows 2003 shutdown reason codes wrong?

I'm trying to give valid shutdown codes using shutdown.exe on a Windows 2003 Server for shutting down because of an environment issue (Major 6, Minor 12 according to the help)
i'm using the following command:
shutdown.exe /s /m \\server1 /t 15 /d 6:12 /c "UPS failure"

Now when I look in the event log, I get the following entry:
The process winlogon.exe has initiated the power off of computer server1 on behalf of user SERVER1\Administrator for the following reason: No title for this reason could be found
 Reason Code: 0x406000c
 Shutdown Type: power off
 Comment: UPS failure

Any idea how I can get the reason to display Power Failure: Environment, as the documentation states? It appears that the Reason code adds an additional 0x04, but I have no idea where that comes from.

Any suggestions welcome :)
1 Solution
Michael WorshamInfrastructure / Solutions ArchitectCommented:
Don't have much experience with reason codes, but I did find this article:

You can also define your own shutdown reasons and add them to the registry. Each reason code should be stored as a registry value in the following key:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Reliability\UserDefined\<default_system_language_ID>

This key contains value names of the following form: xxxxx;nnn;nnnnn. The semicolons delimit the components of a value name.
PicazzoAuthor Commented:
It appears that not all reason codes that are listed can be used by the shutdown command, as other codes work ok. (No idea why they list them then...)
Anyway, I've decided to go for the custom reason codes, which do work.

Thanks for the link

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now