有關主目錄和命運目錄數據不足,做出一些改變,如果需要:
@Echo OFF
:Name_menu
Set /P "Name=Enter the site name >>"
IF NOT DEFINED NAME (Set "Name=" & GOTO:Name_menu)
:Rounds_menu
Set /P "Rounds=Enter number of copies you want (Max 100)>>"
IF NOT DEFINED ROUNDS (Set "Rounds=Name" & GOTO:Rounds_menu)
If %ROUNDS% GTR 99 (Set "Rounds=" & GOTO:Rounds_menu)
:: I've assumed:
:: home dir is the script's dir
:: a folder with the name of the gived website name exists in home dir.
:: you want destiny dir to be "c:\inetpub\wwwroot\"
FOR /L %%# in (0,1,%ROUNDS%) DO (
MKDIR "c:\inetpub\wwwroot\%NAME%\%%#" >NUL
XCOPY /E /Y ".\%NAME%\*" "c:\inetpub\wwwroot\%NAME%\%%#\"
)
:: About "And adding sites into iis as specified times ..."
:: I don't know IIS and what you want, sorry.
Pause&Exit
我試圖將這些文件夾複製到某個目的地並將站點添加到iis ..在單獨的批處理文件 – user1835169
中,正如我想的那樣,它只是具有動態源和目標路徑的複製命令循環,不是嗎? – Raptor
是的..還有一件事,那些文件與輸入數字..ie在1到100之間..和文件夾名稱,即測試或網站......在簡單的我們想要複製的文件夾,在哪裏和多少times ... – user1835169