安装服务:
@echo off
@echo off
set filename=LXServer.exe
set servicename=Service1
set Frameworkdc=%SystemRoot%Microsoft.NETFrameworkv4.0.30319
if exist "%Frameworkdc%" goto netOld
:DispError
echo 您的机器上没有安装 .net Framework 4.0,安装即将终止.
echo 您的机器上没有安装 .net Framework 4.0,安装即将终止 >InstallService.log
goto LastEnd
:netOld
cd %Frameworkdc%
echo 您的机器上安装了相应的.net Framework 4.0,可以安装本服务.
echo 您的机器上安装了相应的.net Framework 4.0,可以安装本服务 >InstallService.log
echo.
echo. >>InstallService.log
C:WindowsMicrosoft.NETFrameworkv4.0.30319installutil.exe E:DebugSendSmsService.exe net start SendSms echo ----------------------------- echo 服务安装成功 echo ----------------------------- pause
卸载服务:
@echo off net stop SendSms C:WindowsMicrosoft.NETFrameworkv4.0.30319installutil.exe E:DebugSendSmsService.exe /u echo ----------------------------- echo 服务卸载成功 echo ----------------------------- pause
保存BAT格式即可