IIS的啟動(dòng)與停止命令
IIS啟動(dòng) net start w3svc
IIS停止 net stop iisreset
DOS下IIS服務(wù)命令:
可以通過(guò)iisreset /?命令來(lái)查看
iisreset /reboot 重啟win2k計(jì)算機(jī)(但有提示系統(tǒng)將重啟信息出現(xiàn))
iisreset /start或stop啟動(dòng)(停止)所有Internet服務(wù)
iisreset /restart停止然后重新啟動(dòng)所有Internet服務(wù)
iisreset /status 顯示所有Internet服務(wù)狀態(tài)
iisreset /enable或disable 在本地系統(tǒng)上啟用(禁用)Internet服務(wù)的重新啟動(dòng)
iisreset /rebootonerror 當(dāng)啟動(dòng)、停止或重新啟動(dòng)Internet服務(wù)時(shí),若發(fā)生錯(cuò)誤將重新開(kāi)機(jī)
iisreset /noforce 若無(wú)法停止Internet服務(wù),將不會(huì)強(qiáng)制終止Internet服務(wù)
iisreset /timeout Val在到達(dá)逾時(shí)間(秒)時(shí),仍未停止Internet服務(wù),若指定/rebootonerror參數(shù),則電腦將會(huì)重新開(kāi)機(jī)。預(yù)設(shè)值為重新啟動(dòng)20秒,停止60秒,重新開(kāi)機(jī)0秒。
批處理
這些批處理需要管理員權(quán)限執(zhí)行
關(guān)閉服務(wù)
把下面代碼存為stop.bat
@echo off
net stop w3svc
net stop iisadmin
net stop msftpsvc
啟動(dòng)服務(wù)
把下面代碼存為stat.bat
@echo off
net start iisadmin
net start w3svc
net start msftpsvc
延時(shí)一段時(shí)間后重新啟動(dòng)IIS
在工作中,需要把IIS停止延時(shí)一段時(shí)間后重新啟動(dòng)IIS。
@echo off
iisreset /stop
echo %time%
choice /t 60 /d y /n >nul
echo %time%
choice /t 5 /d y /n >nul
iisreset /start
保存為IIS_STOP.bat
如果是重新啟動(dòng)沒(méi)有延時(shí),直接用IISRESET即可。
會(huì)員登錄
賬號(hào)登錄還沒(méi)有賬號(hào)?立即注冊(cè)