首页 > 代码库 > .net 服务 安装 卸载 命令行 bat cmd

.net 服务 安装 卸载 命令行 bat cmd

基于.net 4.0


安装

@ECHO OFF
echo 准备安装服务
pause
REM The following directory is for .NET 4.0
set DOTNETFX2=%SystemRoot%\Microsoft.NET\Framework\v4.0.30319
set PATH=%PATH%;%DOTNETFX2%
echo 安装服务...
echo ---------------------------------------------------
InstallUtil /i service.exe
echo ---------------------------------------------------
echo 安装服务成功!
pause
==========================================

卸载

@ECHO OFF
echo 准备卸载服务
pause
REM The following directory is for .NET 4.0
set DOTNETFX2=%SystemRoot%\Microsoft.NET\Framework\v4.0.30319
set PATH=%PATH%;%DOTNETFX2%
echo 卸载服务...
echo ---------------------------------------------------
InstallUtil /u <span style="font-family: Arial, Helvetica, sans-serif;">service</span><span style="font-family: Arial, Helvetica, sans-serif;">.exe</span>echo ---------------------------------------------------
echo 安装卸载成功!
pause
==========================================