0
您好我正在處理一個批處理文件,它將按順序編號文件或鍵入新的文件名。如果要按順序命名文件,則會向用戶詢問起始號碼和結束號碼。我無法弄清楚如何從用戶輸入的開始號碼開始創建新文件,只添加文件直到結束號碼。到目前爲止我的代碼看起來是這樣的:依次創建多個文件限制
@echo off
setlocal
:getConfirmation
set /p consecutive="Are folders numbered consecutively?(y/n): " [y/n] ?:
if %consecutive%==y goto :consecutivefiles
if %consecutive%==n goto :nonconsecutivefiles
:consecutivefiles
set /p start="Starting file number: "
set /p end="Ending file number: "
md
EXIT
:nonconsecutivefiles
set /p name="Type folder name(s): "
md %name%,