Skip to content

Commit 3e8c46a

Browse files
committed
fix(bat): simplify ps1 detection; remove invalid 'else if' constructs; keep window open reliably after elevation
1 parent bac52e2 commit 3e8c46a

1 file changed

Lines changed: 9 additions & 14 deletions

File tree

SystemTester.bat

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,9 @@ echo.
7878
set "SCRIPT_DIR=%cd%"
7979
set "DRIVE_LETTER=%~d0"
8080

81-
:: Locate PowerShell script (supports legacy and _FIXED names)
82-
set "SCRIPT_PS1="
83-
set "SCRIPT_PS1_NAME="
84-
if exist "%SCRIPT_DIR%\SystemTester_FIXED.ps1" (
85-
set "SCRIPT_PS1=%SCRIPT_DIR%\SystemTester_FIXED.ps1"
86-
set "SCRIPT_PS1_NAME=SystemTester_FIXED.ps1"
87-
) else if exist "%SCRIPT_DIR%\SystemTester.ps1" (
88-
set "SCRIPT_PS1=%SCRIPT_DIR%\SystemTester.ps1"
89-
set "SCRIPT_PS1_NAME=SystemTester.ps1"
90-
)
81+
:: Locate PowerShell script (single supported name)
82+
set "SCRIPT_PS1=%SCRIPT_DIR%\SystemTester.ps1"
83+
set "SCRIPT_PS1_NAME=SystemTester.ps1"
9184

9285
:: Check path length
9386
for /f %%i in ('powershell -NoProfile -Command "('%SCRIPT_DIR%').Length" 2^>nul') do set "PATH_LENGTH=%%i"
@@ -249,11 +242,13 @@ set "VERIFY_CODE=%errorlevel%"
249242
echo.
250243
if "%VERIFY_CODE%"=="0" (
251244
echo Verification complete. All tools validated successfully.
252-
) else if "%VERIFY_CODE%"=="2" (
253-
echo [WARNING] Verification completed with issues detected. Review output above.
254-
echo Use Menu Option 5 to re-download the Sysinternals Suite.
255245
) else (
256-
echo [ERROR] Verification encountered an issue. Review output above.
246+
if "%VERIFY_CODE%"=="2" (
247+
echo [WARNING] Verification completed with issues detected. Review output above.
248+
echo Use Menu Option 5 to re-download the Sysinternals Suite.
249+
) else (
250+
echo [ERROR] Verification encountered an issue. Review output above.
251+
)
257252
)
258253
echo.
259254
pause

0 commit comments

Comments
 (0)