安装.bat 内容
set serviceName= CallServer set serviceFilePath= %~dp0\CallServer.exe set serviceDescription= 分诊呼叫服务 sc.exe create %serviceName% BinPath= %serviceFilePath% sc.exe config %serviceName% start= auto sc.exe config %serviceName% type= interact type= own sc.exe description %serviceName% %serviceDescription% sc.exe start %serviceName% @echo "启动服务成功!" pause pause
卸载.bat 内容
set serviceName=CallServer sc.exe stop %serviceName% sc.exe delete %serviceName% pause
重启.bat 内容
set serviceName=CallServer net stop %serviceName% && net start %serviceName%
标签:serviceName%,exe,发布命令,windows,pause,set,sc,net6,CallServer From: https://www.cnblogs.com/xxxin/p/17888501.html