- 人气:
- 放大
- 缩小
- 二维码
- 赞赏
delphi 用IISReset命令重启IIS
function ControlIIS(const strAction:string='restart'):Boolean;
//参数 /restart 停止并重起所有INTERNET服务
// /start 启动所有INTERNET 服务
// /stop 停止所有INTERNET服务
// /reboot 重起计算机
// /Status 显示所有INTERNET服务状态等等
var
sCmd:string;
begin
sCmd:='IISReset/'+strAction;
try
WinExec(pchar(sCmd),SW_HIDE);
//ShellExecute(handle,'open',pchar(sCmd),'-s',' ',SW_HIDE);
Result := True;
except
//messagedlg('执行失败',mtinformation,[mbok],0);
Result := False;
end;
end;
http://blog.csdn.net/xieyunc/article/details/4142896