[USER=35331]@echo[/USER] off set "sourceDir=C:\1" set "destinationDir=C:\2" set "newFolderName=NewSubfolder" set "folderExists=" :checkFolderExists rem Check if the new folder name exists in the destination directory if exist "%destinationDir%\%newFolderName%" ( set /a "counter+=1" set "newFolderName=NewSubfolder%counter%" goto checkFolderExists ) mkdir "%destinationDir%\%newFolderName%" 2>nul for /D %%I in ("%sourceDir%\*") do ( move "%%I" "%destinationDir%\%newFolderName%\" ) pause