{"id":4330,"date":"2021-11-09T12:29:18","date_gmt":"2021-11-09T12:29:18","guid":{"rendered":"https:\/\/lgildv5i97.onrocket.site\/answers\/?post_type=question&#038;p=4330"},"modified":"2021-11-09T12:29:42","modified_gmt":"2021-11-09T12:29:42","slug":"solved-cmd-dir-command-exclude-files-in-list","status":"publish","type":"question","link":"https:\/\/computing.net\/answers\/programming\/cmd-dir-command-exclude-files-in-list\/29192.html","title":{"rendered":"Solved CMD DIR Command Exclude Files In List"},"content":{"rendered":"<p>Hello all,<\/p>\n<p>I want to execute a dir command but exclude some files from the result.<\/p>\n<p>for example in a dir I have:<\/p>\n<p>C:\\Folder\\a.pdf<br \/>\nC:\\Folder\\b.exe<br \/>\nC:\\Folder\\c.csv<br \/>\nC:\\Folder\\d.ini<\/p>\n<p>also I have a txt file which is located in &#8220;C:blacklist.txt&#8221; which has this entries:<br \/>\na.pdf<br \/>\nc.csv<\/p>\n<p>now I want to use something like this:<\/p>\n<p>dir C:\\Folder \/exclude=C:\\blacklist.txt<br \/>\nand the result would look like this:<\/p>\n<p>C:\\Folder\\b.exe<br \/>\nC:\\Folder\\d.ini<\/p>\n<p>xcopy has exclude, any chance at dir command?<\/p>\n<p>The Problem is that I will need the listed files excluded on the fly, means I can&#8217;t use the method:<\/p>\n<p>dir all files\/folders, have them printed into a txt file and then use loop to delete the files in blacklist.txt<\/p>\n<p>Thanks in advance!<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"iawp_total_views":3},"question-category":[55],"question_tags":[],"class_list":["post-4330","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\/4330","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=4330"}],"wp:attachment":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/media?parent=4330"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question-category?post=4330"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question_tags?post=4330"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}