利用批处理重启IIS服务

作者:我就是个世界 发表于:2007-11-10
将以下代码存储为[color=#FF0000]iisrestart.bat[/color]文件,你可以通过双击此文件运行来重启IIS服务。

你也可以将它存储至C:\winnt\system32下面,那么你可以通过command方式直接调用该程序来重启IIS服务,或是直接在cmd模式下输入:[color=#008000]iisrestart [/color]


[code]@echo off
REM - File: iisrestart.bat
REM - Description: Restart's IIS (Web, FTP, SMTP)
REM - Author: Pete Freitag CFDEV.COM
REM - ADD REM comments if you don't want to restart any
REM - of Services
echo Restarting IIS...
echo ======================================================
net stop "World Wide Web Publishing Service"
net start "World Wide Web Publishing Service"
net stop "FTP Publishing Service"
net start "FTP Publishing Service"
net stop "Simple Mail Transport Protocol (SMTP)"
net start "Simple Mail Transport Protocol (SMTP)"
echo ======================================================
echo IIS Restarted [/code]

[color=#FF0000]iisrestart.bat[/color]附件:[file][attach]37[/attach][/file]

分享:

扫一扫在手机阅读、分享本文

请发表您的评论