Created
March 31, 2021 06:42
-
-
Save heiwa4126/49e60ebee90cb2f32850bd71f915c971 to your computer and use it in GitHub Desktop.
.batをダブルクリックで管理者権限で実行する。ダイアログはでるけど「右クリックで管理者権限で実行」よりは全然楽。もとは https://4thsight.xyz/13971 。空白を含むパスで実行すると死ぬバグを直した。
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 | |
cd /d "%~dp0" | |
for /f "tokens=3 delims=\ " %%i in ('whoami /groups^|find "Mandatory"') do set LEVEL=%%i | |
if NOT "%LEVEL%"=="High" ( | |
powershell.exe -NoProfile -ExecutionPolicy RemoteSigned -Command "Start-Process \"%~f0\" -Verb runas" | |
exit | |
) | |
rem これ以降に、実行したい処理を記述します |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment