@echo off

echo ------------------------------------

echo 强制关闭Xray核心(管理员权限)

echo ------------------------------------

echo.

gsudo cache on

gsudo schtasks.exe /End /tn "StartXrayCore"

gsudo taskkill /f /im xray.exe

gsudo taskkill /f /im XrayUI.exe

cd /d %~dp0

del /f /s /q .\config\proxy_outbounds.jsonc

del /f /s /q .\config\node*

del /f /s /q .\config\*_dns.jsonc

del /f /s /q .\config\*_routing.jsonc

gsudo schtasks.exe /delete /tn "StartXrayCore" /f

gsudo reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 00000000 /f"

gsudo reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /t REG_DWORD /d 00000000 /f"

gsudo reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyOverride /t REG_DWORD /d 00000000 /f"

rem gsudo netsh interface ipv4 set dnsservers name="以太网" source=dhcp

rem gsudo netsh interface ipv4 set dnsservers name="WLAN" source=dhcp

rem gsudo netsh interface ipv6 set dnsservers name="以太网" source=dhcp

rem gsudo netsh interface ipv6 set dnsservers name="WLAN" source=dhcp

cls

echo ------------------------------------

echo Xray核心已关闭!

echo ------------------------------------

pause > nul

exit