W :fixermenu @echo off cls rem Define variables set "ruleName=hola" set "foundRule=" set…
- User
W :fixer_menu @echo off cls rem Define variables set "ruleName=hola" set "foundRule=" set "softwareName=AndroidEmulatorEn" set "executablePath=" rem Check if the firewall is enabled netsh advfirewall show allprofiles state | find "State" | find "ON" >nul if %errorlevel% neq 0 ( echo Windows Firewall is disabled. Please enable the firewall to use this fixer. pause goto fixer_menu ) rem Check if the process is running and get the path for /f "tokens=1" %%i in ('tasklist /fo csv ^| find /I "AndroidEmulatorEn.exe"') do ( set "processName=%%~i" ) rem Get the executable path based on the process name for /f "tokens=2 delims=," %%i in ('wmic process where "name='AndroidEmulatorEn.exe'" get ExecutablePath /format:csv ^| find /I "AndroidEmulatorEn.exe"') do ( set "executablePath=%%~i" ) rem If the path was not found, exit if "%executablePath%"=="" ( echo Gameloop is not running. Please ensure it is running. pause goto menu ) rem Check if the rule exists netsh advfirewall firewall show rule name="%ruleName%" >nul 2>&1 if %errorlevel% equ 0 ( set "foundRule=true" ) else ( set "foundRule=" ) cls rem Reset color to default color 07 rem Display current status at the top if defined foundRule ( color 2F echo Current Status : Fixer on ) else ( color 4F echo Current Status : Fixer off ) echo. echo Select an option: echo 1. Start Fixer echo 2. Stop Fixer echo 3. No match found fix echo 4. Main menu choice /C 1234 /N /M "Enter your choice (1-4): " if errorlevel 4 ( color 07 goto menu ) if errorlevel 3 ( echo Fixing... netsh advfirewall firewall add rule name="%ruleName%" protocol=TCP remoteport=9031,443,8700,8013,20002,80,8088,8086,9030,20000,10427,9031,10012,10012,17500 dir=out action=block program="%executablePath%" set "foundRule=" powershell -c "[console]::beep(1000,500)" >nul 2>&1 timeout /t 3 >nul netsh advfirewall firewall delete rule name="%ruleName%" >nul 2>&1 set "foundRule=" powershell -c "[console]::beep(1000,500)" >nul 2>&1 ) else if errorlevel 2 ( netsh advfirewall firewall delete rule name="%ruleName%" >nul 2>&1 set "foundRule=" powershell -c "[console]::beep(1000,500)" >nul 2>&1 ) else if errorlevel 1 ( echo Starting Fixer.. REM Add firewall rule for the specified software netsh advfirewall firewall add rule name="%ruleName%" protocol=TCP remoteport=9031,443,8700,8013,20002,80,8088,8086,9030,20000,10427,9031,10012,10012,17500 dir=out action=block program="%executablePath%" set "foundRule=true" powershell -c "[console]::beep(1000,500)" >nul 2>&1 ) rem Stay on the Fixer menu after an action is taken goto fixermenu : foundrule should continue checking after every 1 second whether rule hola is present in list of outbound rules and keep updating current status and setting appropriate color. if rule hola is added or deleted by externall program when fixer menu is open , the change should be immediately reflected on current status and respective color
- Assistant