日期:2014-05-17 浏览次数:20460 次
C:\Windows\Microsoft.NET\Framework\v4.0.30319>installutil F:\win2008iis\testPro\
MySerSL\WindowsService1\bin\Debug\WindowsService1.exe
@chcp 936
@echo off
set serviceName=服务名称
echo 将在当前目录进行安装...
echo 清理原有服务项...
"%~dp0\installutil" /u "%~dp0\%serviceName%.exe" >> InstallService.log
echo 清理完毕
echo.
echo *********************
echo 安装服务...
"%~dp0\installutil" /i "%~dp0\%serviceName%.exe" >> InstallService.log
echo 安装成功!
echo 启动服务...
net start "%serviceName%"
echo 服务已成功启动!
echo 5秒后自动退出...
@ping 127.0.0.1 -n 5 >nul
exit