1
0
mirror of https://github.com/r4sas/chocolatey-packages synced 2025-01-21 04:10:05 +00:00
chocolatey-packages/yggdrasil/tools/service-start.bat
R4SAS 7cce575241
switch yggdrasil package to new installer (dev)
Signed-off-by: R4SAS <r4sas@i2pmail.org>
2019-12-20 13:03:48 +03:00

31 lines
837 B
Batchfile

@set @_cmd=1 /*
@echo off
setlocal EnableExtensions
title Yggdrasil
whoami /groups | findstr "S-1-16-12288" >nul && goto :admin
if "%~1"=="RunAsAdmin" goto :error
echo Requesting privileges elevation for managing the dnscrypt-proxy service . . .
cscript /nologo /e:javascript "%~f0" || goto :error
exit /b
:error
echo.
echo Error: Administrator privileges elevation failed,
echo please manually run this script as administrator.
echo.
goto :end
:admin
sc start "Yggdrasil"
:end
set /p =Press [Enter] to exit . . .
exit /b */
// JScript, restart batch script as administrator
var objShell = WScript.CreateObject('Shell.Application');
var ComSpec = WScript.CreateObject('WScript.Shell').ExpandEnvironmentStrings('%ComSpec%');
objShell.ShellExecute(ComSpec, '/c ""' + WScript.ScriptFullName + '" RunAsAdmin"', '', 'runas', 1);