@echo off setlocal enabledelayedexpansion rem Check if the script is running with…
- User
@echo off setlocal enabledelayedexpansion
rem Check if the script is running with administrative privileges net session >nul 2>&1 if %errorlevel% neq 0 ( echo Requesting administrative privileges... powershell -Command "Start-Process cmd -Argument '/c %~s0 %*' -Verb runAs" exit /b )
Title Fixer
rem Define variables set "ruleName=hola" set "softwareName=HD-Player" set "executablePath=" set "lastStatus="
rem Set path to store msi_path.txt in the Documents folder set "docPath=%USERPROFILE%\Documents\msi_path.txt"
rem Check if the MSI App Player path is already set in the Documents folder if exist "%docPath%" ( for /f "delims=" %%a in (%docPath%) do set "MsiPath=%%a" set "executablePath=!MsiPath!" goto check_firewall ) else ( set "MsiPath=" set "executablePath=" )
:fixer_menu cls echo. echo MSI App Player Path Manager echo. echo 1) Set MSI App Player Path echo 2) Change Path echo 3) Exit echo. set /p "choice=Select an option (1-3): "
if "%choice%"=="1" goto set_path if "%choice%"=="2" goto change_path if "%choice%"=="3" exit /b goto fixer_menu
:set_path cls rem Default path to HD-Player.exe (usually C:\Program Files\BlueStacks_msi5\HD-Player.exe) set "defaultMsiPath=C:\Program Files\BlueStacks_msi5\HD-Player.exe" echo Enter the path to HD-Player.exe or press Enter to use the default path: echo Default: !defaultMsiPath! set /p "MsiPath=Path: " if "!MsiPath!"=="" set "MsiPath=!defaultMsiPath!" echo "!MsiPath!" > "%docPath%" set "executablePath=!MsiPath!" echo Path saved successfully in the Documents folder. pause goto check_firewall
:change_path cls if "!MsiPath!"=="" ( echo No path is currently set. ) else ( echo Current path: !MsiPath! ) echo. echo Enter the new path to HD-Player.exe: set /p "MsiPath=New Path: " if not "!MsiPath!"=="" ( echo "!MsiPath!" > "%docPath%" set "executablePath=!MsiPath!" ) echo Path updated successfully in the Documents folder. pause goto check_firewall
:check_firewall rem Check if the firewall is enabled netsh advfirewall show allprofiles state | find "State" | find "ON" >nul if %errorlevel% neq 0 ( cls echo Windows Firewall is disabled. Please enable the firewall to use this fixer. pause goto fixer_menu )
:display_menu cls echo ............................................................................................................. echo BGMI FIXER echo ............................................................................................................. echo.
call :check_rule_status call :display_status echo. echo Select an option: echo 1. Start Fixer [ALT + F] echo 2. Stop Fixer [ALT + G] echo 3. No match found fix [ALT + H] echo 4. Ignore this option echo 5. Go to MSI App player path manager
:wait_for_input rem Wait for user input or check status every second choice /C 12345 /N /T 1 /D 4 >nul if errorlevel 5 ( goto fixer_menu ) if errorlevel 4 ( call :check_rule_status if "!currentStatus!" neq "!lastStatus!" ( goto display_menu ) goto wait_for_input ) if errorlevel 3 ( call :no_match_fix goto display_menu ) if errorlevel 2 ( call :stop_fixer goto display_menu ) if errorlevel 1 ( call :start_fixer goto display_menu ) goto wait_for_input
- Assistant
When the script runs for the first time and works correctly, but fails to work on subsequent runs, it could indicate a problem with how the path is stored and retrieved from
msi_path.txt. It is possible that the path is not being set properly when the script reads it back from the file. Let's examine potential causes and solutions: - User
give updated code which shouldnt have any such issues
- Assistant
- User
terminal opened and closed
- Assistant