First post here I am new to creating batch files and have created the below batch file. Basically, when we get a new assignment we copy the template folder and then rename it the next unused folder name, eg. if the last folder was 15-P0028 the next one would be 15-P0029. the batch works perfectly! But, sometimes we want to add a client name to the end of the folder name, eg. 15-P0029 Brown. I want the batch to pause for user input after renaming the folder the next in sequence so we can enter a client name or just hit enter to insert the new folder without the client name.
Can anyone help me with this, it would be greatly appreciated
Code: Select all
@echo off
setlocal enableDelayedExpansion
cd /d C:\Users\jbrown\Desktop\Test
set I=2
:NextI
if /I %I% LEQ 999 set II=0%I%
if /I %I% LEQ 99 set II=00%I%
if /I %I% LEQ 9 set II=000%I%
if not exist "15-P!II!" (
xcopy /s /e /i "15-P0000-Template" "15-P!II!"
goto :eof
)
set /a I+=1
if /i %I% LSS 9999 goto NextI
)