{"id":95515,"date":"2017-02-21T07:00:00","date_gmt":"2017-02-21T22:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/?p=95515"},"modified":"2019-03-13T01:06:45","modified_gmt":"2019-03-13T08:06:45","slug":"20170221-00","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20170221-00\/?p=95515","title":{"rendered":"Psychic debugging: Why does opening a command prompt always print a weird error message?"},"content":{"rendered":"<p>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. <\/p>\n<div STYLE=\"background-color: black;color: white;font-family: Consolas, Lucida Console, Courier New, monospace;padding: 1ex;width: 80ex\">Microsoft Windows [Version 10.0.14393]<br \/>(c) 2016 Microsoft Corporation. All rights reserved.<br \/>The filename, directory name, or volume label syntax is incorrect.<\/p>\n<p>C:\\&gt; <\/p><\/div>\n<p>Where is that message &#8220;The filename, directory name, or volume label syntax is incorrect&#8221; coming from? <\/p>\n<p>My psychic powers tell me that it&#8217;s coming from <a HREF=\"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/20071121-00\/?p=24433\/\">AutoRun<\/a>. <\/p>\n<p>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&#8217;m guessing that there&#8217;s a rogue AutoRun entry that is doing something which is generating that message. <\/p>\n<p>For example, I was able to reproduce the message by doing this: <\/p>\n<pre>\nreg add \"HKCU\\Software\\Microsoft\\Command Processor\" \/v AutoRun \/d \\\"C:|\n<\/pre>\n<p>After running this command, open a command prompt, and you&#8217;ll get that same error message. <\/p>\n<p>And before you forget, run this command to get rid of the bogus AutoRun: <\/p>\n<pre>\nreg delete \"HKCU\\Software\\Microsoft\\Command Processor\" \/v AutoRun \/f\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Check your AutoRun.<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[104],"class_list":["post-95515","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-tipssupport"],"acf":[],"blog_post_summary":"<p>Check your AutoRun.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/95515","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=95515"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/95515\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=95515"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=95515"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=95515"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}