在Windows系統(tǒng)中用批處理腳本自動(dòng)安裝以及自動(dòng)卸載IIS的方式方法
[重要通告]如您遇疑難雜癥,本站支持知識(shí)付費(fèi)業(yè)務(wù),掃右邊二維碼加博主微信,可節(jié)省您寶貴時(shí)間哦!
作為一個(gè)小站長(zhǎng),或者說(shuō)搜索這篇文章的人,估計(jì)都是會(huì)一些網(wǎng)絡(luò)建設(shè)的人,那用到IIS是必然,很多時(shí)間大家都在說(shuō)安裝IIS很困難,其實(shí)自我感覺(jué)還挺簡(jiǎn)單的吧,今天就來(lái)整理一下bat安裝IIS,運(yùn)行一次,五分鐘不用動(dòng),解決問(wèn)題的方式,具體請(qǐng)看哦;
安裝IIS
使用批處理命令自動(dòng)安裝IIS。
注:以下代碼片段保存為.bat
格式即可。
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
IIS7:適用于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
IIS8:適用于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
卸載IIS
使用批處理命令自動(dòng)卸載IIS。
@echo off
color 0a
echo 正在卸載IIS功能,這可能需要幾分鐘時(shí)間...
start /w pkgmgr /uu:IIS-WebServerRole;WAS-WindowsActivationService;WAS-ProcessModel
echo IIS已卸載成功!
pause
以上是IIS8含以及以上的IIS用批處理bat方式安裝的,2019的,直接看站內(nèi)文章吧;
windows server 2019/2016IIS安裝及相關(guān)設(shè)置(配置)
以上內(nèi)容均可保存為Bat來(lái)運(yùn)行,如不想保存設(shè)置,請(qǐng)支付一點(diǎn)兒辛苦維護(hù)費(fèi)可直接下載運(yùn)行;
問(wèn)題未解決?付費(fèi)解決問(wèn)題加Q或微信 2589053300 (即Q號(hào)又微信號(hào))右上方掃一掃可加博主微信
所寫(xiě)所說(shuō),是心之所感,思之所悟,行之所得;文當(dāng)無(wú)敷衍,落筆求簡(jiǎn)潔。 以所舍,求所獲;有所依,方所成!
win7 測(cè)試無(wú)效
@tp900: 這個(gè)是個(gè)硬茬子,不太好解決,很多客戶(hù)都沒(méi)有解決!