In most network environments, it’s a good idea to document the reasons for shutting down or restarting computers. With unplanned shutdowns, you can document the shutdown in the computer’s system log by expanding the syntax to include the following parameters:
/e /c "UnplannedReason" /d MajorCode:MinorCode
where /C “UnplannedReason” sets the detailed reason (which can be up to 127 characters in length) for the shutdown or restart, and /D MajorCode:MinorCode sets the reason code for the shutdown. Reason codes are arbitrary, with valid major codes ranging from 0 to 255 and valid minor reason codes ranging from 0 to 65,535. Consider the following example:
shutdown /r /e /m \\Mailer1 /c "System Reset" /d 5:15
In this example, you are restarting MAILER1 and documenting the reason for the unplanned restart as a “System Reset” using the reason code 5:15.
With planned shutdowns and restarts, prefix the reason codes with p: to indicate a planned shutdown, as shown here:
/e /c "PlannedReason" /d p:MajorCode:MinorCode
For instance, consider the following code:
shutdown /r /e /m \\Mailer1 /c "Planned Application Upgrade" /d p:4:2
Good Post,thank you