{"id":7392,"date":"2021-11-24T00:23:06","date_gmt":"2021-11-24T00:23:06","guid":{"rendered":"https:\/\/lgildv5i97.onrocket.site\/answers\/?post_type=question&#038;p=7392"},"modified":"2021-11-24T00:24:04","modified_gmt":"2021-11-24T00:24:04","slug":"if-exist-not-working-for-a-folder-with-spaces","status":"publish","type":"question","link":"https:\/\/computing.net\/answers\/programming\/if-exist-not-working-for-a-folder-with-spaces\/20573.html","title":{"rendered":"If Exist Not Working For a Folder With Spaces"},"content":{"rendered":"<p>I&#8217;m trying to determine in a directory exist using a batch file in XP.<\/p>\n<p>Microsoft basically says <a href=\"https:\/\/web.archive.org\/web\/20200920014302\/http:\/\/support.microsoft.com\/kb\/65994\" rel=\"nofollow noopener\" target=\"_blank\">use NUL after the pathname<\/a><\/p>\n<p><i> The syntax for checking for a directory existance is&#8230;<br \/>\nif exist c:\\windows\\nul then goto exists<\/i><\/p>\n<p>I want to test for the existence of a folder with spaces in the name. The obvious solution is to enclose the name inside double quotes. I can&#8217;t seem to get that to work either.<\/p>\n<p>Here&#8217;s an example of what I&#8217;m trying:<\/p>\n<p>if exist &#8220;C:\\Documents and Settings\\NUL&#8221; goto YES<br \/>\necho The file does not exist<br \/>\ngoto END<br \/>\n:YES<br \/>\necho The file exists<br \/>\n:END<\/p>\n<p>I have tried using spaces and quote marks in various combinations. I cannot find a way to test for the existence of a directory with spaces in it. Can you help?<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"iawp_total_views":11},"question-category":[55],"question_tags":[],"class_list":["post-7392","question","type-question","status-publish","hentry","question-category-programming"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question\/7392","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question"}],"about":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/types\/question"}],"author":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/comments?post=7392"}],"wp:attachment":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/media?parent=7392"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question-category?post=7392"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question_tags?post=7392"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}