Windows系統(tǒng)使用批處理(bat)腳本自動(dòng)安裝與卸載 IIS

[重要通告]如您遇疑難雜癥,本站支持知識(shí)付費(fèi)業(yè)務(wù),掃右邊二維碼加博主微信,可節(jié)省您寶貴時(shí)間哦!

Windowsx系統(tǒng)使用批處理bat)腳本自動(dòng)安裝卸載 IIS

IIS7X:適用于win 7、win server 2008

@echo off echo 正在添加IIS功能,這可能需要幾分鐘時(shí)間...
start /w pkgmgr /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;IIS-ApplicationDevelopment;IIS-ASPNET;IIS-NetFxExtensibility;IIS-ASP;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-ServerSideIncludes;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-ODBCLogging;IIS-Security;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS-DigestAuthentication;IIS-ClientCertificateMappingAuthentication;IIS-IISCertificateMappingAuthentication;IIS-URLAuthorization;IIS-RequestFiltering;IIS-IPSecurity;IIS-Performance;IIS-WebServerManagementTools;IIS-ManagementConsole;IIS-ManagementScriptingTools;IIS-ManagementService;IIS-IIS6ManagementCompatibility;IIS-Metabase;IIS-WMICompatibility;IIS-LegacyScripts;IIS-LegacySnapIn;WAS-WindowsActivationService;WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPI
echo IIS已添加成功!
pause

IIS8X:適用于win 8、win server 2012

@echo off echo 正在添加IIS8功能,這可能需要幾分鐘時(shí)間...
start /w pkgmgr /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;IIS-ApplicationDevelopment;IIS-ASPNET;IIS-NetFxExtensibility;NetFx4Extended-ASPNET45;IIS-ASP;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-ServerSideIncludes;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-ODBCLogging;IIS-Security;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS-DigestAuthentication;IIS-ClientCertificateMappingAuthentication;IIS-IISCertificateMappingAuthentication;IIS-URLAuthorization;IIS-RequestFiltering;IIS-IPSecurity;IIS-Performance;IIS-WebServerManagementTools;IIS-ManagementConsole;IIS-ManagementScriptingTools;IIS-ManagementService;IIS-IIS6ManagementCompatibility;IIS-Metabase;IIS-WMICompatibility;IIS-LegacyScripts;IIS-LegacySnapIn;WAS-WindowsActivationService;WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPI
echo IIS8安裝成功!
pause

IIS6:適用于win server 2003

:: *******************
:: * 安裝
:: *******************
:Install
Cls
@echo. && @echo 安裝正在進(jìn)行中...
:: 生成 IIS 6.0 安裝腳本,啟用 ASP,ASP.NET
@echo [Components]> %TEMP%\IIS_Install.txt
@echo iis_common = ON>> %TEMP%\IIS_Install.txt
@echo iis_www = ON>> %TEMP%\IIS_Install.txt
@echo iis_asp = ON>> %TEMP%\IIS_Install.txt
@echo iis_inetmgr = ON>> %TEMP%\IIS_Install.txt
@echo aspnet = ON>> %TEMP%\IIS_Install.txt
:: 安裝 IIS 6.0
%windir%\System32\Sysocmgr.exe /i:sysoc.inf /u:%TEMP%\IIS_Install.txt
del /q /f %windir%\*.log >nul 2>nul
del /q /f %TEMP%\IIS_Install.txt >nul 2>nul
del /q /f %TEMP%\ASPNETSetup.log >nul 2>nul
:: 配置 IIS 啟用父路徑
@cscript /nologo C:\Inetpub\AdminScripts\adsutil.vbs set W3SVC/AspEnableParentPaths 1 >nul 2>nul
Goto Install_End

IIS組件的動(dòng)態(tài)安裝方法(WIN7和WIN7以上版本才能只能執(zhí)行) 保存為bat文件,右鍵管理員運(yùn)行

dism.exe /online /NoRestart /enable-feature /featurename:NetFx3
dism.exe /online /NoRestart /enable-feature /featurename:IIS-WebServerRole
dism.exe /online /NoRestart /enable-feature /featurename:IIS-WebServer
dism.exe /online /NoRestart /enable-feature /featurename:IIS-CommonHttpFeatures
dism.exe /online /NoRestart /enable-feature /featurename:IIS-HttpErrors
dism.exe /online /NoRestart /enable-feature /featurename:IIS-HttpRedirect
dism.exe /online /NoRestart /enable-feature /featurename:IIS-ApplicationDevelopment
dism.exe /online /NoRestart /enable-feature /featurename:IIS-Security
dism.exe /online /NoRestart /enable-feature /featurename:IIS-URLAuthorization
dism.exe /online /NoRestart /enable-feature /featurename:IIS-RequestFiltering
dism.exe /online /NoRestart /enable-feature /all /featurename:IIS-NetFxExtensibility
dism.exe /online /NoRestart /enable-feature /featurename:IIS-NetFxExtensibility45
dism.exe /online /NoRestart /enable-feature /featurename:IIS-HealthAndDiagnostics
dism.exe /online /NoRestart /enable-feature /featurename:IIS-HttpLogging
dism.exe /online /NoRestart /enable-feature /featurename:IIS-LoggingLibraries
dism.exe /online /NoRestart /enable-feature /featurename:IIS-RequestMonitor
dism.exe /online /NoRestart /enable-feature /featurename:IIS-HttpTracing
dism.exe /online /NoRestart /enable-feature /featurename:IIS-IPSecurity
dism.exe /online /NoRestart /enable-feature /featurename:IIS-Performance
dism.exe /online /NoRestart /enable-feature /featurename:IIS-HttpCompressionDynamic
dism.exe /online /NoRestart /enable-feature /featurename:IIS-ManagementScriptingTools
dism.exe /online /NoRestart /enable-feature /featurename:IIS-IIS6ManagementCompatibility
dism.exe /online /NoRestart /enable-feature /featurename:IIS-WebServerManagementTools
dism.exe /online /NoRestart /enable-feature /featurename:IIS-Metabase
dism.exe /online /NoRestart /enable-feature /featurename:IIS-HostableWebCore
dism.exe /online /NoRestart /enable-feature /featurename:IIS-CertProvider
dism.exe /online /NoRestart /enable-feature /featurename:IIS-ISAPIExtensions
dism.exe /online /NoRestart /enable-feature /featurename:IIS-ISAPIFilter
dism.exe /online /NoRestart /enable-feature /featurename:IIS-StaticContent
dism.exe /online /NoRestart /enable-feature /featurename:IIS-DefaultDocument
dism.exe /online /NoRestart /enable-feature /featurename:IIS-DirectoryBrowsing
dism.exe /online /NoRestart /enable-feature /featurename:IIS-WebDAV
dism.exe /online /NoRestart /enable-feature /featurename:IIS-WebSockets
dism.exe /online /NoRestart /enable-feature /featurename:IIS-ApplicationInit
dism.exe /online /NoRestart /enable-feature /featurename:IIS-ASPNET
dism.exe /online /NoRestart /enable-feature /featurename:IIS-ASPNET45
dism.exe /online /NoRestart /enable-feature /featurename:NetFx4Extended-ASPNET45
dism.exe /online /NoRestart /enable-feature /featurename:IIS-ASP
dism.exe /online /NoRestart /enable-feature /featurename:IIS-CGI
dism.exe /online /NoRestart /enable-feature /featurename:IIS-ServerSideIncludes
dism.exe /online /NoRestart /enable-feature /featurename:IIS-CustomLogging
dism.exe /online /NoRestart /enable-feature /featurename:IIS-BasicAuthentication
dism.exe /online /NoRestart /enable-feature /featurename:IIS-HttpCompressionStatic
dism.exe /online /NoRestart /enable-feature /featurename:IIS-ManagementConsole
dism.exe /online /NoRestart /enable-feature /featurename:IIS-ManagementService
dism.exe /online /NoRestart /enable-feature /featurename:IIS-WMICompatibility
dism.exe /online /NoRestart /enable-feature /featurename:IIS-LegacyScripts
dism.exe /online /NoRestart /enable-feature /featurename:IIS-LegacySnapIn
dism.exe /online /NoRestart /enable-feature /featurename:IIS-FTPServer
dism.exe /online /NoRestart /enable-feature /featurename:IIS-FTPSvc
dism.exe /online /NoRestart /enable-feature /featurename:IIS-FTPExtensibility
dism.exe /online /NoRestart /enable-feature /featurename:IIS-WindowsAuthentication
dism.exe /online /NoRestart /enable-feature /featurename:IIS-DigestAuthentication
dism.exe /online /NoRestart /enable-feature /featurename:IIS-ClientCertificateMappingAuthentication
dism.exe /online /NoRestart /enable-feature /featurename:IIS-IISCertificateMappingAuthentication
dism.exe /online /NoRestart /enable-feature /featurename:IIS-ODBCLogging
dism.exe /online /NoRestart /enable-feature /featurename:IIS-FTPExtensibility

卸載IIS就比較統(tǒng)一了,請看下面~~

@echo off
color 0a
echo 正在卸載IIS功能,這可能需要幾分鐘時(shí)間...
start /w pkgmgr /uu:IIS-WebServerRole;WAS-WindowsActivationService;WAS-ProcessModel
echo IIS已卸載成功!
pause

 

問題未解決?付費(fèi)解決問題加Q或微信 2589053300 (即Q號(hào)又微信號(hào))右上方掃一掃可加博主微信

所寫所說,是心之所感,思之所悟,行之所得;文當(dāng)無敷衍,落筆求簡潔。 以所舍,求所獲;有所依,方所成!

支付寶贊助
微信贊助

免責(zé)聲明,若由于商用引起版權(quán)糾紛,一切責(zé)任均由使用者承擔(dān)。

您必須遵守我們的協(xié)議,如您下載該資源,行為將被視為對(duì)《免責(zé)聲明》全部內(nèi)容的認(rèn)可->聯(lián)系老梁投訴資源
LaoLiang.Net部分資源來自互聯(lián)網(wǎng)收集,僅供用于學(xué)習(xí)和交流,請勿用于商業(yè)用途。如有侵權(quán)、不妥之處,請聯(lián)系站長并出示版權(quán)證明以便刪除。 敬請諒解! 侵權(quán)刪帖/違法舉報(bào)/投稿等事物聯(lián)系郵箱:service@laoliang.net
意在交流學(xué)習(xí),歡迎贊賞評(píng)論,如有謬誤,請聯(lián)系指正;轉(zhuǎn)載請注明出處: » Windows系統(tǒng)使用批處理(bat)腳本自動(dòng)安裝與卸載 IIS

發(fā)表回復(fù)

本站承接,網(wǎng)站推廣(SEM,SEO);軟件安裝與調(diào)試;服務(wù)器或網(wǎng)絡(luò)推薦及配置;APP開發(fā)與維護(hù);網(wǎng)站開發(fā)修改及維護(hù); 各財(cái)務(wù)軟件安裝調(diào)試及注冊服務(wù)(金蝶,用友,管家婆,速達(dá),星宇等);同時(shí)也有客戶管理系統(tǒng),人力資源,超市POS,醫(yī)藥管理等;

立即查看 了解詳情