有关主目录和命运目录数据不足,做出一些改变,如果需要:
@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