{"id":15153,"date":"2010-01-28T07:00:00","date_gmt":"2010-01-28T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2010\/01\/28\/what-idiot-would-hard-code-the-path-to-notepad\/"},"modified":"2010-01-28T07:00:00","modified_gmt":"2010-01-28T07:00:00","slug":"what-idiot-would-hard-code-the-path-to-notepad","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20100128-00\/?p=15153","title":{"rendered":"What idiot would hard-code the path to Notepad?"},"content":{"rendered":"<p>There seemed to be a great deal of disbelief that <a href=\"http:\/\/blogs.msdn.com\/oldnewthing\/archive\/2006\/03\/28\/563008.aspx#563177\"> anybody would hard-code the path to Notepad<\/a>.\n <a href=\"http:\/\/web.archive.org\/web\/20071112140003\/http:\/\/support.installshield.com\/kb\/view.asp?articleid=Q108710\"> Here&#8217;s one example<\/a> and <a href=\"http:\/\/www.code-magazine.com\/article.aspx?quickid=0001061&amp;page=3\"> here&#8217;s another<\/a>.<\/p>\n<p> There&#8217;s a large class of problems that go like this: <\/p>\n<blockquote class=\"q\"><p> I&#8217;m running Program&nbsp;X, and when I tell it to view the error log, I get this error message: <code>CreateProcess of \"C:\\Windows\\Notepad.exe errorlog.txt\" failed: <a href=\"http:\/\/blogs.msdn.com\/oldnewthing\/archive\/2010\/01\/27\/9953807.aspx\"> error&nbsp;2<\/a>: The system cannot find the file specified.<\/code> What is wrong and how do I fix it? <\/p><\/blockquote>\n<p> Obviously, the file <code>C:\\Windows\\Notepad.exe<\/code> is missing. But how can that be? Well, Windows Server&nbsp;2008 bit the bullet and removed one of the copies of Notepad. Once you learn this, troubleshooting the above problem becomes a simple exercise in psychic debugging. <\/p>\n<blockquote class=\"m\"><p> My psychic powers tell me that you&#8217;re running Windows Server&nbsp;2008. The Notepad program no longer exists in the Windows directory; it&#8217;s now in the system directory. Find the setting for your program that lets you change the program used for viewing error logs and tell it to use <code>C:\\Windows\\System32\\Notepad.exe<\/code>. <\/p><\/blockquote>\n<p> Of course, this tip works only if the program permits you to change the program used for viewing error logs. If they hard-code the path, then you&#8217;ll have to find some other workaround. (For example, you might try using the <a href=\"http:\/\/blogs.msdn.com\/cjacks\/archive\/2007\/10\/15\/using-the-correctfilepaths-shim-to-redirect-files-on-windows-vista.aspx\"> CorrectFilePaths shim<\/a>.) <\/p>\n","protected":false},"excerpt":{"rendered":"<p>There seemed to be a great deal of disbelief that anybody would hard-code the path to Notepad. Here&#8217;s one example and here&#8217;s another. There&#8217;s a large class of problems that go like this: I&#8217;m running Program&nbsp;X, and when I tell it to view the error log, I get this error message: CreateProcess of &#8220;C:\\Windows\\Notepad.exe errorlog.txt&#8221; [&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":[25],"class_list":["post-15153","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>There seemed to be a great deal of disbelief that anybody would hard-code the path to Notepad. Here&#8217;s one example and here&#8217;s another. There&#8217;s a large class of problems that go like this: I&#8217;m running Program&nbsp;X, and when I tell it to view the error log, I get this error message: CreateProcess of &#8220;C:\\Windows\\Notepad.exe errorlog.txt&#8221; [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/15153","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=15153"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/15153\/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=15153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=15153"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=15153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}