Skip to content

Commit 773f061

Browse files
committed
Create run.bat
1 parent a6760cd commit 773f061

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/run.bat

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
@echo off
2+
:-------------------------------------
3+
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
4+
5+
if '%errorlevel%' NEQ '0' (
6+
echo Requesting administrative privileges...
7+
goto UACPrompt
8+
) else ( goto gotAdmin )
9+
10+
:UACPrompt
11+
echo Set UAC = CreateObject("Shell.Application") > "%temp%\getadmin.vbs"
12+
echo UAC.ShellExecute "cmd.exe", "/c ""%~s0""", "", "runas", 1 >> "%temp%\getadmin.vbs"
13+
"%temp%\getadmin.vbs"
14+
del "%temp%\getadmin.vbs"
15+
exit /B
16+
17+
:gotAdmin
18+
pushd "%CD%"
19+
CD /D "%~dp0"
20+
:--------------------------------------
21+
22+
cd ..
23+
24+
set EXE_PATH="%CD%\RAMMap.exe"
25+
26+
echo Running %EXE_PATH% as administrator...
27+
start "" %EXE_PATH%

0 commit comments

Comments
 (0)