{"id":32673,"date":"2006-01-13T10:00:19","date_gmt":"2006-01-13T10:00:19","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2006\/01\/13\/why-do-words-beginning-with-home-get-treated-as-urls\/"},"modified":"2006-01-13T10:00:19","modified_gmt":"2006-01-13T10:00:19","slug":"why-do-words-beginning-with-home-get-treated-as-urls","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20060113-19\/?p=32673","title":{"rendered":"Why do words beginning with &#034;home&#034; get treated as URLs?"},"content":{"rendered":"<p>Vitaly <a href=\"http:\/\/blogs.msdn.com\/oldnewthing\/articles\/407234.aspx\"> from the Suggestion Box<\/a> asked (with grammatical editing),<\/p>\n<blockquote class=\"q\"><p> Could you explain why Windows starts the web browser if the file name passed to ShellExecute starts with &#8220;home&#8221;. <\/p><\/blockquote>\n<p> First thing to note is that this URL-ization happens only after <a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/shellcc\/platform\/shell\/reference\/functions\/shellexecuteex.asp\"> the <code>ShellExecuteEx<\/code> function<\/a> has tried all the other possible interpretations. If a file named &#8220;<a href=\"http:\/\/www.homestarrunner.com\/\">homestar<\/a>&#8221; is found in the current directory or on the PATH or in the App Paths, then that file will be chosen, as you would expect. Only when the <code>ShellExecuteEx<\/code> function is about to give up does it try to &#8220;do what you mean&#8221;.\n What you&#8217;re seeing is <a href=\"http:\/\/blogs.msdn.com\/oldnewthing\/archive\/2005\/06\/22\/431530.aspx\"> autocorrection<\/a> kicking in yet again. If you go to  <code>HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\URL\\Prefixes<\/code>, you can see the various autocorrection rules that ShellExecute consults when it can&#8217;t figure out what you are trying to do. For example, if the thing you typed begins with &#8220;www&#8221;, it will stick &#8220;http:\/\/&#8221; in front and try again. This is why you can just type &#8220;www.microsoft.com&#8221; into the Run dialog instead of having to type the cumbersome &#8220;http:\/\/www.microsoft.com&#8221;.\n Most of the autocorrection rules are pretty self-evident. Something beginning with &#8220;ftp&#8221; is probably an FTP site. Something beginning with &#8220;www&#8221; is probably a web site. But why are strings beginning with &#8220;home&#8221; also treated as web sites?\n For one thing, several <a href=\"http:\/\/home.netscape.com\/\"> web sites have domains whose names begin with &#8220;home&#8221;<\/a>. Furthermore, some internet service providers set up their DNS so that non-fully-qualified domain names go to servers that the ISP set up specifically to provide customer services. For example, &#8220;mail&#8221; would send you to a web-based mail system, and &#8220;home&#8221; would send you to the ISP&#8217;s home page.<\/p>\n<p> The use of &#8220;home&#8221; has fallen out of fashion of late, so the auto-correction rule isn&#8217;t all that useful any more, but the rule stays around because it doesn&#8217;t really hurt anybody, and compatibility concerns advise against removing a feature if it isn&#8217;t hurting anyone and you aren&#8217;t absolutely certain that nobody is still using it. (Heck, if you look at the key, you can see an entry for &#8220;gopher&#8221;. Like anybody uses gopher any more.) <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Vitaly from the Suggestion Box asked (with grammatical editing), Could you explain why Windows starts the web browser if the file name passed to ShellExecute starts with &#8220;home&#8221;. First thing to note is that this URL-ization happens only after the ShellExecuteEx function has tried all the other possible interpretations. If a file named &#8220;homestar&#8221; is [&hellip;]<\/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-32673","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-tipssupport"],"acf":[],"blog_post_summary":"<p>Vitaly from the Suggestion Box asked (with grammatical editing), Could you explain why Windows starts the web browser if the file name passed to ShellExecute starts with &#8220;home&#8221;. First thing to note is that this URL-ization happens only after the ShellExecuteEx function has tried all the other possible interpretations. If a file named &#8220;homestar&#8221; is [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/32673","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=32673"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/32673\/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=32673"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=32673"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=32673"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}