IIS application initialization setup srcipt
cd C:/windows/system32/inetsrv
set Arr[0]=NathanTesting
set "x=0"
:SymLoop
if defined Arr[%x%] (
call appcmd set apppool "%%Arr[%x%]%%" /autoStart:true /startMode:AlwaysRunning /processModel.idleTimeout:00:00:00
call appcmd set site "%%Arr[%x%]%%" /serverAutoStart:true
call appcmd list apps /site.name:"%%Arr[%x%]%%" /xml |appcmd set app /in /preloadEnabled:true
call appcmd set config -section:system.applicationHost/sites "/[name='%%Arr[%x%]%%'].applicationDefaults.preLoadEnabled:true" /commit:apphost
set /a "x+=1"
GOTO :SymLoop
)
上面會做:
set Arr[0]=NathanTesting
set "x=0"
:SymLoop
if defined Arr[%x%] (
call appcmd set apppool "%%Arr[%x%]%%" /autoStart:true /startMode:AlwaysRunning /processModel.idleTimeout:00:00:00
call appcmd set site "%%Arr[%x%]%%" /serverAutoStart:true
call appcmd list apps /site.name:"%%Arr[%x%]%%" /xml |appcmd set app /in /preloadEnabled:true
call appcmd set config -section:system.applicationHost/sites "/[name='%%Arr[%x%]%%'].applicationDefaults.preLoadEnabled:true" /commit:apphost
set /a "x+=1"
GOTO :SymLoop
)
上面會做:
- Set Application Pool autoStart = true, startMode = AlwaysRunning, IdleTimeout = 0
- Set Site serverAutoStart = true
- Set EVERY application within the site to preloadEnabled = true
- Set applicationDefaults.preLoadEnabled of site to true
留言
張貼留言