Skip to content
This repository has been archived by the owner on Jun 15, 2022. It is now read-only.

Commit

Permalink
Automatically Obtain Admin Permission
Browse files Browse the repository at this point in the history
  • Loading branch information
t4rra committed May 16, 2021
1 parent 0645d44 commit a75e171
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions 5kblHotspotHelper.bat
Original file line number Diff line number Diff line change
@@ -1,20 +1,7 @@
@echo off

goto check_Permissions

:check_Permissions

net session >nul 2>&1
if %errorLevel% == 0 (
goto setup
) else (
echo.
echo Please run this script again with admininstrator priviliges.
echo.
pause
exit

)
%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit
cd /d "%~dp0"

:setup
setlocal enableDelayedExpansion
Expand Down

0 comments on commit a75e171

Please sign in to comment.