{"id":13529,"date":"2021-12-13T11:09:59","date_gmt":"2021-12-13T11:09:59","guid":{"rendered":"https:\/\/lgildv5i97.onrocket.site\/answers\/?post_type=question&#038;p=13529"},"modified":"2021-12-13T11:13:43","modified_gmt":"2021-12-13T11:13:43","slug":"dos-batch-if-file-exists-rename-sequentially","status":"publish","type":"question","link":"https:\/\/computing.net\/answers\/programming\/dos-batch-if-file-exists-rename-sequentially\/26293.html","title":{"rendered":"DOS Batch If File Exists Rename Sequentially"},"content":{"rendered":"<p>Hello all,<br \/>\nI am creating a DOS Batch file to process large collections of archive files. The batch un-archives each file and re-archives each file individually to zip format. Once I have a zip I want to move them to a destination directory. Before the move occurs I&#8217;d like to test if that exact zip file name exists. If it exists, I will need to increment the filename sequentially and then test again. I&#8217;ve found several examples of sequentially incrementing file names in a for loop, but not one that will allow me to test the filename again (2nd, 3rd, 4th, etc times) and increase the filename sequentially to come up with a unique filename.<\/p>\n<p>Any ideas? I&#8217;m reluctant to post broken code but I can show you what I&#8217;ve got if you need to see more. Many thanks!<\/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":[47],"question_tags":[],"class_list":["post-13529","question","type-question","status-publish","hentry","question-category-hardware"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question\/13529","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=13529"}],"wp:attachment":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/media?parent=13529"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question-category?post=13529"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question_tags?post=13529"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}