A quick and dirty way to convert Windows error codes to strings is to use the NET HELPMSG
command.
C:\> NET HELPMSG 2 The system cannot find the file specified. C:\> NET HELPMSG 8242 An invalid dn syntax has been specified.
The command is not infallible, however.
- It operates only on Windows error codes. It doesn’t decode
HRESULT
orNTSTATUS
values. - It doesn’t support messages with insertions, presumably because it doesn’t pass the
FORMAT_
MESSAGE_
IGNORE_
INSERTS
flag.
If you pass a message with an insertion, such as ERROR_
WRONG_
DISK
, then instead of getting
The wrong diskette is in the drive. Insert %2 (Volume Serial Number: %3) into drive %1.
you get¹
C:\> NET HELPMSG 34 34 is not a valid Windows network message number. More help is available by typing NET HELPMSG 3871.
Still, it’s better than nothing.
¹ As a bonus insult, if you type the suggested command, you get this:
C:\> NET HELPMSG 3871 *** is not a valid Windows network message number.
Yeah, um, that really didn’t tell me anything new.
0 comments