Skip to content

Instantly share code, notes, and snippets.

View ioakie's full-sized avatar

Christian Skarsgard ioakie

  • Lubbock, Texas
View GitHub Profile
@Maximus5
Maximus5 / get-admin.bat
Last active May 31, 2024 17:18
Sample batch to run itself elevated
@echo off
echo Checking for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
echo Permission check result: %errorlevel%
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...