Skip to content
This repository was archived by the owner on Jul 11, 2022. It is now read-only.

Commit 53438f0

Browse files
authored
Updated
1 parent 2fe5f62 commit 53438f0

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

start_service.bat

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
@echo off
2+
:: This runs the batch file as an admin - required UAC to be off
3+
:: This is just an asty hack in to get job done cause we host it on windows dedi.
4+
:: BatchGotAdmin
5+
:-------------------------------------
6+
REM --> Check for permissions
7+
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
8+
9+
REM --> If error flag set, we do not have admin.
10+
if '%errorlevel%' NEQ '0' (
11+
echo Requesting administrative privileges...
12+
goto UACPrompt
13+
) else ( goto gotAdmin )
14+
15+
:UACPrompt
16+
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
17+
set params = %*:"=""
18+
echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"
19+
20+
"%temp%\getadmin.vbs"
21+
del "%temp%\getadmin.vbs"
22+
exit /B
23+
24+
:gotAdmin
25+
pushd "%CD%"
26+
CD /D "%~dp0"
27+
:--------------------------------------
28+
:: your commands begin from this point.
29+
:: stops the service and then starts it
30+
net stop Natsuki
31+
net start Natsuki

0 commit comments

Comments
 (0)