@echo off
echo 注：请“以管理员身份运行”该文件
echo 正在添加IIS，可能需要几分钟到几十分钟，具体取决于网速及缺失组件数量
dism /Online /Enable-Feature /FeatureName:IIS-WebServerRole /NoRestart
dism /Online /Enable-Feature /FeatureName:IIS-WebServer /NoRestart
dism /Online /Enable-Feature /FeatureName:IIS-CommonHttpFeatures /NoRestart
dism /Online /Enable-Feature /FeatureName:IIS-StaticContent /NoRestart
dism /Online /Enable-Feature /FeatureName:IIS-DefaultDocument /NoRestart
dism /Online /Enable-Feature /FeatureName:IIS-DirectoryBrowsing /NoRestart
dism /Online /Enable-Feature /FeatureName:IIS-HttpErrors /NoRestart
dism /Online /Enable-Feature /FeatureName:IIS-HttpRedirect /NoRestart
dism /Online /Enable-Feature /FeatureName:IIS-ApplicationDevelopment /NoRestart
dism /Online /Enable-Feature /FeatureName:IIS-NetFxExtensibility /all /NoRestart
dism /Online /Enable-Feature /FeatureName:IIS-NetFxExtensibility45 /all /NoRestart
dism /Online /Enable-Feature /FeatureName:NetFx4Extended-ASPNET45 /all /NoRestart
dism /Online /Enable-Feature /FeatureName:IIS-ASPNET /all /NoRestart
dism /Online /Enable-Feature /FeatureName:IIS-ASPNET45 /all /NoRestart
dism /Online /Enable-Feature /FeatureName:IIS-ASP /NoRestart
dism /Online /Enable-Feature /FeatureName:IIS-ISAPIExtensions /NoRestart
dism /Online /Enable-Feature /FeatureName:IIS-ISAPIFilter /NoRestart
dism /Online /Enable-Feature /FeatureName:IIS-HealthAndDiagnostics /NoRestart
dism /Online /Enable-Feature /FeatureName:IIS-HttpLogging /NoRestart
dism /Online /Enable-Feature /FeatureName:IIS-LoggingLibraries /NoRestart
dism /Online /Enable-Feature /FeatureName:IIS-RequestMonitor /NoRestart
dism /Online /Enable-Feature /FeatureName:IIS-HttpTracing /NoRestart
dism /Online /Enable-Feature /FeatureName:IIS-Security /NoRestart
dism /Online /Enable-Feature /FeatureName:IIS-BasicAuthentication /NoRestart
dism /Online /Enable-Feature /FeatureName:IIS-WindowsAuthentication /NoRestart
dism /Online /Enable-Feature /FeatureName:IIS-DigestAuthentication /NoRestart
dism /Online /Enable-Feature /FeatureName:IIS-URLAuthorization /NoRestart
dism /Online /Enable-Feature /FeatureName:IIS-RequestFiltering /NoRestart
dism /Online /Enable-Feature /FeatureName:IIS-IPSecurity /NoRestart
dism /Online /Enable-Feature /FeatureName:IIS-Performance /NoRestart
dism /Online /Enable-Feature /FeatureName:IIS-WebServerManagementTools /NoRestart
dism /Online /Enable-Feature /FeatureName:IIS-ManagementConsole /NoRestart
dism /Online /Enable-Feature /FeatureName:IIS-ManagementScriptingTools /NoRestart
dism /Online /Enable-Feature /FeatureName:IIS-ManagementService /NoRestart
dism /Online /Enable-Feature /FeatureName:IIS-IIS6ManagementCompatibility /NoRestart
dism /Online /Enable-Feature /FeatureName:IIS-Metabase /NoRestart
dism /Online /Enable-Feature /FeatureName:IIS-WMICompatibility /NoRestart
dism /Online /Enable-Feature /FeatureName:IIS-LegacyScripts /NoRestart
dism /Online /Enable-Feature /FeatureName:IIS-LegacySnapIn /NoRestart
dism /Online /Enable-Feature /FeatureName:WAS-WindowsActivationService /NoRestart
dism /Online /Enable-Feature /FeatureName:WAS-ProcessModel /NoRestart
dism /Online /Enable-Feature /FeatureName:WAS-NetFxEnvironment /NoRestart
dism /Online /Enable-Feature /FeatureName:WAS-ConfigurationAPI /NoRestart
echo 操作已处理完毕!
if "%1" NEQ "noWait" pause

