Created
October 23, 2021 02:45
-
-
Save schrobby/42c0cd4dca984788f2f2139d70d70efe to your computer and use it in GitHub Desktop.
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 | |
net session >nul 2>&1 | |
if %errorLevel% neq 0 ( | |
echo ERROR: Run again with admin privileges. | |
exit 1 | |
) | |
netsh interface ipv4 set subinterface "NordLynx" mtu=1300 store=persistent | |
netsh interface ipv4 show subinterfaces "NordLynx" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This will call admin prompt
@echo off
call :isAdmin
if %errorlevel% == 0 (
goto :run
) else (
echo Requesting administrative privileges...
goto :UACPrompt
)
exit /b
:isAdmin
fsutil dirty query %systemdrive% >nul
exit /b
:run
netsh interface ipv4 set subinterface "NordLynx" mtu=1320
netsh interface ipv4 show subinterface
pause
exit /b
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "cmd.exe", "/c %~s0 %~1", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
exit /B