批处理安装服务
使用InstallUtil.exe 安装
安装服务脚本 自动管理员运行,自动定位到当前目录
@echo off&color 17
if exist "%SystemRoot%\SysWOW64" path %path%;%windir%\SysNative;%SystemRoot%\SysWOW64;%~dp0
bcdedit >nul
if '%errorlevel%' NEQ '0' (goto UACPrompt) else (goto UACAdmin)
:UACPrompt
%1 start "" mshta vbscript:createobject("shell.application").shellexecute("""%~0""","::",,"runas",1)(window.close)&exit
exit /B
:UACAdmin
cd /d "%~dp0"
C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe "SyncService.exe"
pause
卸载服务脚本 自动管理员运行,自动定位到当前目录
@echo off&color 17
if exist "%SystemRoot%\SysWOW64" path %path%;%windir%\SysNative;%SystemRoot%\SysWOW64;%~dp0
bcdedit >nul
if '%errorlevel%' NEQ '0' (goto UACPrompt) else (goto UACAdmin)
:UACPrompt
%1 start "" mshta vbscript:createobject("shell.application").shellexecute("""%~0""","::",,"runas",1)(window.close)&exit
exit /B
:UACAdmin
cd /d "%~dp0"
C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe /u "SyncService.exe"
pause
版权声明:本文为YES开发框架网发布内容,转载请附上原文出处连接
post YES开发框架