Windows Service 安装脚本

Install.bat

@ECHO OFF

REM The following directory is for .NET 2.0
set DOTNETFX2=%SystemRoot%\Microsoft.NET\Framework\v2.0.50727
set PATH=%PATH%;%DOTNETFX2%

echo Installing WindowsService...
echo ---------------------------------------------------
start InstallUtil /i Services1.exe
echo ---------------------------------------------------
echo Done.

Uninstall.bat

@ECHO OFF

REM The following directory is for .NET 2.0
set DOTNETFX2=%SystemRoot%\Microsoft.NET\Framework\v2.0.50727
set PATH=%PATH%;%DOTNETFX2%

echo Installing WindowsService...
echo ---------------------------------------------------
start InstallUtil /u Service1.exe
echo ---------------------------------------------------
echo Done.

和编译文件放同一目录,OK

.net 4.0中改动为

set DOTNETFX2=%SystemRoot%\Microsoft.NET\Framework\v4.0.30319

附上一个winService的框架 下载

posted @ 2012-03-07 21:44  徐某人  阅读(512)  评论(0编辑  收藏  举报