{"id":11163,"date":"2011-03-22T07:00:00","date_gmt":"2011-03-22T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2011\/03\/22\/why-is-there-the-message-do-not-use-this-registry-key-in-the-registry\/"},"modified":"2011-03-22T07:00:00","modified_gmt":"2011-03-22T07:00:00","slug":"why-is-there-the-message-do-not-use-this-registry-key-in-the-registry","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20110322-00\/?p=11163\/","title":{"rendered":"Why is there the message &#039;!Do not use this registry key&#039; in the registry?"},"content":{"rendered":"<p>Under <code>Software\\Microsoft\\Windows\\Current&shy;Version\\Explorer\\Shell Folders<\/code>, there is a message to registry snoopers: The first value is called &#8220;!Do not use this registry key&#8221; and the associated data is the message &#8220;Use the SH&shy;Get&shy;Folder&shy;Path or SH&shy;Get&shy;Known&shy;Folder&shy;Path function instead.&#8221;\n I added that message.\n <a href=\"http:\/\/blogs.msdn.com\/oldnewthing\/archive\/2003\/11\/03\/55532.aspx\"> The long and sad story of the Shell Folders key<\/a> explains that the registry key exists only to retain backward compatibility with four programs written in 1994. There&#8217;s also <a href=\"http:\/\/technet.microsoft.com\/en-us\/magazine\/2005.11.windowsconfidential.aspx\"> a TechNet version of the article<\/a> which is just as sad but not as long.\n One customer saw this message and complained, &#8220;That registry key and that TechNet article explain how to <i>obtain<\/i> the current locations of those special folders, but they don&#8217;t explain how to <i>change<\/i> them. This type of woefully inadequate documentation only makes the problem worse.&#8221;\n Hey, wow, a little message in a registry key and a magazine article are now &#8220;documentation&#8221;! The TechNet article is historical background. And the registry key is just a gentle nudge. Neither is documentation. It&#8217;s not like I&#8217;m going to put a complete copy of the documentation into a registry key. Documentation lives in places like MSDN.\n But it seems that some people need more than a nudge; they need a shove. Let&#8217;s see, we&#8217;re told that the functions for obtaining the locations of known folders are <code>SH&shy;Get&shy;Folder&shy;Path<\/code> and its more modern counterpart <code>SH&shy;Get&shy;Known&shy;Folder&shy;Path<\/code>. I wonder what the names of the functions for modifying those locations might be?\n Man that&#8217;s a tough one. I&#8217;ll let you puzzle that out for a while.\n Okay, here, I&#8217;ll tell you: The corresponding functions go by the completely unobvious names <code>SH&shy;<u>Set&shy;<\/u>Folder&shy;Path<\/code> and <code>SH&shy;<u>Set&shy;<\/u>Known&shy;Folder&shy;Path<\/code>.<\/p>\n<p> Sorry you had to use your brain. I&#8217;ll let you get back to programming now. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Under Software\\Microsoft\\Windows\\Current&shy;Version\\Explorer\\Shell Folders, there is a message to registry snoopers: The first value is called &#8220;!Do not use this registry key&#8221; and the associated data is the message &#8220;Use the SH&shy;Get&shy;Folder&shy;Path or SH&shy;Get&shy;Known&shy;Folder&shy;Path function instead.&#8221; I added that message. The long and sad story of the Shell Folders key explains that the registry key exists [&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":[2],"class_list":["post-11163","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-history"],"acf":[],"blog_post_summary":"<p>Under Software\\Microsoft\\Windows\\Current&shy;Version\\Explorer\\Shell Folders, there is a message to registry snoopers: The first value is called &#8220;!Do not use this registry key&#8221; and the associated data is the message &#8220;Use the SH&shy;Get&shy;Folder&shy;Path or SH&shy;Get&shy;Known&shy;Folder&shy;Path function instead.&#8221; I added that message. The long and sad story of the Shell Folders key explains that the registry key exists [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/11163","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=11163"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/11163\/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=11163"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=11163"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=11163"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}