Last active
August 11, 2024 17:44
-
-
Save Dadangdut33/015d245f96303d43fb859bcd3379eda2 to your computer and use it in GitHub Desktop.
A simple bat script to run thing as admin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| if "%1"=="runas" ( | |
| cd %~dp0 | |
| start "" "full_path_of.exe" | |
| ) else ( | |
| powershell Start -File "cmd '/K %~f0 runas'" -Verb RunAs | |
| ) | |
| exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Explanation:
Source bat script: https://stackoverflow.com/a/69794302