Skip to content

Instantly share code, notes, and snippets.

View KaioHSG's full-sized avatar
👍
Bom dia.

Kaio HSG KaioHSG

👍
Bom dia.
View GitHub Profile
@KaioHSG
KaioHSG / uac-credential.bat
Last active June 26, 2024 04:34
UAC Credential: require administrator privileges in a script.
:: Start
@echo off
title UAC Credential
:: UAC Credential
whoami /groups | find "S-1-16-12288" > nul
if %errorLevel% neq 0 (
:: Non-admin message
echo Accept Administrator Privileges to continue.
echo createObject("shell.application"^).shellExecute "%~s0", "", "", "runas", 1 > "%temp%\uac_%~n0.vbs"