Enhancements

A more elegant stop
This commit is contained in:
fridorin 2025-02-24 20:14:42 +03:00
parent f7a2220afd
commit f70fe5cb27

View File

@ -1,14 +1,14 @@
@echo off @echo off
chcp 65001 >nul chcp 65001 > nul
:: 65001 - UTF-8 :: 65001 - UTF-8
set "arg=%1" net session >nul 2>&1
if "%arg%" == "admin" ( if %errorLevel% neq 0 (
echo Restarted with admin rights echo Requesting admin rights...
) else (
powershell -Command "Start-Process 'cmd.exe' -ArgumentList '/k \"\"%~f0\" admin\"' -Verb RunAs" powershell -Command "Start-Process 'cmd.exe' -ArgumentList '/k \"\"%~f0\" admin\"' -Verb RunAs"
exit /b exit /b
) )
if "%1"=="admin" echo Started with admin rights
set SRVCNAME=zapret set SRVCNAME=zapret
@ -19,3 +19,8 @@ net stop "WinDivert"
sc delete "WinDivert" sc delete "WinDivert"
net stop "WinDivert14" net stop "WinDivert14"
sc delete "WinDivert14" sc delete "WinDivert14"
echo Services have been stopped
pause
endlocal