Psychic debugging: Why does opening a command prompt always print a weird error message?

Raymond Chen

Every so often, somebody reports that whenever they open a command prompt, they get a weird error message between the version banner and the prompt.

Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
The filename, directory name, or volume label syntax is incorrect.

C:\>

Where is that message “The filename, directory name, or volume label syntax is incorrect” coming from?

My psychic powers tell me that it’s coming from AutoRun.

AutoRun is a hidden gotcha of the command processor which lets you set a registry key to inject a command into every command prompt as soon as it starts up. And I’m guessing that there’s a rogue AutoRun entry that is doing something which is generating that message.

For example, I was able to reproduce the message by doing this:

reg add "HKCU\Software\Microsoft\Command Processor" /v AutoRun /d \"C:|

After running this command, open a command prompt, and you’ll get that same error message.

And before you forget, run this command to get rid of the bogus AutoRun:

reg delete "HKCU\Software\Microsoft\Command Processor" /v AutoRun /f

0 comments

Discussion is closed.

Feedback usabilla icon