@echo off
::设置服务名称 set service_name=SangforADSSO ::设置服务描述 set service_description=深信服单点登入代理服务 ::设置服务程序路径 set prog_path=C:\Program Files\Sangfor ADSSO\ADSSO_Start.exe ::设置服务的启动方式 auto:自动 demand:手动 disabled:禁用 set strt=auto echo EasyService 一键服务 echo =========================================================== ::pause ::======================以下部分勿随意修改========================== set s32=%windir%system32 set reg_file=EasyService.reg net stop %service_name% 2>nul %s32%instsrv.exe %service_name% remove 2>nul %s32%instsrv.exe %service_name% %s32%srvany.exe >nul ::设置服务的启动方式 auto:自动 demand:手动 disabled:禁用 sc config %service_name% start= %strt% sc description %service_name% "%service_description%" echo 生成注册表文件… echo Windows Registry Editor Version 5.00 > %reg_file% echo [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServices%service_name%Parameters] >> %reg_file% echo "Application"="%prog_path%" >> %reg_file% echo 导入注册表文件… %reg_file% net start %service_name% echo ===========================完成============================ pause
转载于:https://blog.51cto.com/1615459/976510