Making a folder with incrementing number depending on existing folders with same name
问题 I want to make a batch file which creates a folder with an incremented number when there is one already existing with the same name. For example for a folder called folder something like this: if exist folder md folder1 if exist folder1 md folder2 What I want is to make another folder with an incremented number at the end when there are already 1 or more folders with the same name (folder1, folder2, ...) and make the code shorter. 回答1: This batch code is based on your initial idea: @echo off