@echo off @echo off set filename=LXServer.exe set servicename=Service1 set Frameworkdc=%SystemRoot%\Microsoft.NET\Framework\v4.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:\Windows\Microsoft.NET\Framework\v4.0.30319\installutil.exe E:\Debug\SendSmsService.exe net start SendSms echo ----------------------------- echo 服务安装成功 echo ----------------------------- pause
安装服务
@echo off net stop SendSms C:\Windows\Microsoft.NET\Framework\v4.0.30319\installutil.exe E:\Debug\SendSmsService.exe /u echo ----------------------------- echo 服务卸载成功 echo ----------------------------- pause
卸载服务
@echo off rem 服务安装工具 title install service tool echo start... F: cd "F:\RemoveFilter" InstallUtil.exe RemoveFilter.exe ::InstallUtil.exe /u RemoveFilter.exe pause
简洁
时间: 2024-10-13 05:12:18