core: 添加 frpc 内网穿透

This commit is contained in:
bin456789
2025-04-28 23:18:27 +08:00
parent 3f1d5ce9fa
commit bbf78e6d9a
13 changed files with 397 additions and 27 deletions

View File

@ -0,0 +1,18 @@
@echo off
mode con cp select=437 >nul
rem 如果找到 LOCAL SERVICE 运行的 frpc则结束 SYSTEM 运行的 frpc
rem 如果没找到 frpc则运行 frpc本脚本是用 SYSTEM 运行,好像无法 runas "NT AUTHORITY\LOCAL SERVICE"
rem tasklist 返回值始终为 0因此需要用 findstr
:loop
tasklist /FI "IMAGENAME eq frpc.exe" /FI "USERNAME eq NT AUTHORITY\LOCAL SERVICE" | findstr /I "frpc.exe" && goto :kill_system_frpc
tasklist /FI "IMAGENAME eq frpc.exe" | findstr /I "frpc.exe" || start %SystemDrive%\frpc\frpc.exe -c %SystemDrive%\frpc\frpc.toml
timeout 5
goto :loop
:kill_system_frpc
taskkill /F /T /FI "IMAGENAME eq frpc.exe" /FI "USERNAME eq NT AUTHORITY\SYSTEM"
del "%~f0"