我目前有这个批处理文件,允许我在 IIS 中创建应用程序和应用程序池。它可以工作,但它只创建一个应用程序和应用程序池。
这是我当前的脚本:
@echo ON
setlocal enabledelayedexpansion
REM "Content Source path"
set arg1=%1
REM "Content destination path"
set arg2=%2
REM "apps to setup"
set arg3=%3
REM Split virt names and loop through it.
FOR /F "tokens=1* delims=," %%a in (%arg3%) do (
set vir=%%a
set pool=!vir!!poolname!
REM CREATE APPLICATION
%systemroot%\system32\inetsrv\APPCMD add app /site.name:"Default Web Site" /path:/!vir! /physicalpath:"%arg2%"
REM CREATE APP POOL
%systemroot%\system32\inetsrv\appcmd add apppool /name:!pool! /managedPipelineMode:Integrated /processModel.identityType:ApplicationPoolIdentity /enable32BitAppOnWin64:false
REM ASSIGN APP POOL TO APPLICATION
%systemroot%\system32\inetsrv\appcmd set app /app.name:"Default Web Site/!vir!" /applicationPool:!pool!
):END Endlocal
install.bat "c:\source" "c:\target" "APP1,APP2,APP3"
请有人告诉我我做错了什么。
谢谢。