{"id":10272,"date":"2021-12-05T07:51:28","date_gmt":"2021-12-05T07:51:28","guid":{"rendered":"https:\/\/lgildv5i97.onrocket.site\/answers\/?post_type=question&#038;p=10272"},"modified":"2021-12-05T07:52:12","modified_gmt":"2021-12-05T07:52:12","slug":"ms-dos-how-to-deal-with-an-em-dash-in-a-filename","status":"publish","type":"question","link":"https:\/\/computing.net\/answers\/programming\/ms-dos-how-to-deal-with-an-em-dash-in-a-filename\/29584.html","title":{"rendered":"MS Dos: How To Deal With An Em Dash In a Filename"},"content":{"rendered":"<p>On a PC with Windows 7, I&#8217;m using a simple DOS script to rename some Excel files, pre-pending their parent folder name:<\/p>\n<p>for \/f &#8220;delims=&#8221; %%i in (&#8216;dir \/b \/AD&#8217;) do (<br \/>\ncd &#8220;%%i&#8221;<br \/>\nfor \/f &#8220;delims=&#8221; %%j in (&#8216;dir \/b *.xl*&#8217;) do ren &#8220;%%~j&#8221; &#8220;%%i_%%~j&#8221;<br \/>\ncd..<br \/>\n)<\/p>\n<p>I noticed that some files generated an error, &#8220;System cannot find the specified file.&#8221; These files all had an em dash (\u2014) in the filename. After I changed the em dash to a regular hyphen (-), using Windows Explorer, the script worked fine on these files.<\/p>\n<p>How can I help MS Dos recognize and rename these files?<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"iawp_total_views":7},"question-category":[55],"question_tags":[],"class_list":["post-10272","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\/10272","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=10272"}],"wp:attachment":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/media?parent=10272"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question-category?post=10272"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question_tags?post=10272"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}