Skip to content

Commit 5d98fa4

Browse files
committed
update
1 parent 7c99bf5 commit 5d98fa4

2 files changed

Lines changed: 12 additions & 32 deletions

File tree

SystemTester.bat

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,11 @@ echo.
5555

5656
set "_ELEV_ARGS=/elevated"
5757
if "%ST_DEBUG%"=="1" set "_ELEV_ARGS=/elevated debug"
58-
if "%ST_DEBUG%"=="1" echo [%DATE% %TIME%] Elevating: "%~f0" %_ELEV_ARGS% >> "%LAUNCH_LOG%"
59-
powershell -NoProfile -ExecutionPolicy Bypass -Command "Start-Process -FilePath '%~f0' -ArgumentList '%_ELEV_ARGS%' -Verb RunAs -WorkingDirectory '%CD%' -WindowStyle Normal"
60-
58+
powershell -NoProfile -ExecutionPolicy Bypass -Command "Start-Process -FilePath '%~f0' -ArgumentList '%_ELEV_ARGS%' -Verb RunAs -WorkingDirectory '%~dp0'"
6159
if errorlevel 1 (
62-
echo [ERROR] Failed to elevate. Run manually as administrator.
60+
echo [ERROR] Failed to elevate.
6361
pause
6462
)
65-
echo.
66-
echo Press any key to close this window. The elevated window should now be open.
67-
pause >nul
6863
exit /b
6964

7065
:ADMIN_CONFIRMED
@@ -121,9 +116,7 @@ if "%SCRIPT_PS1%"=="" (
121116

122117
echo Using PowerShell script: %SCRIPT_PS1_NAME%
123118
if "%ST_DEBUG%"=="1" (
124-
set "_EX=NO"
125-
if exist "%SCRIPT_PS1%" set "_EX=YES"
126-
>> "%LAUNCH_LOG%" echo [%DATE% %TIME%] Using PS1: "%SCRIPT_PS1%" (exists: !_EX!)
119+
echo [%DATE% %TIME%] Using PS1: "%SCRIPT_PS1%" ^(exists: ^<^%SCRIPT_PS1%^^?^) >> "%LAUNCH_LOG%"
127120
)
128121
echo.
129122

@@ -194,8 +187,7 @@ echo.
194187
pause
195188
set "PS_EXTRA="
196189
if "%ST_DEBUG%"=="1" set "PS_EXTRA=-NoExit"
197-
if "%ST_DEBUG%"=="1" echo [%DATE% %TIME%] Launching PS interactive: powershell -NoProfile -ExecutionPolicy Bypass %PS_EXTRA% -File "%SCRIPT_PS1%" >> "%LAUNCH_LOG%"
198-
powershell -NoProfile -ExecutionPolicy Bypass %PS_EXTRA% -File "%SCRIPT_PS1%"
190+
powershell.exe -NoProfile -ExecutionPolicy Bypass %PS_EXTRA% -File "%SCRIPT_PS1%"
199191
echo.
200192
if errorlevel 1 (
201193
echo [ERROR] Script failed (code: %errorlevel%)
@@ -219,8 +211,7 @@ pause
219211
echo.
220212
set "PS_EXTRA="
221213
if "%ST_DEBUG%"=="1" set "PS_EXTRA=-NoExit"
222-
if "%ST_DEBUG%"=="1" echo [%DATE% %TIME%] Launching PS autorun: powershell -NoProfile -ExecutionPolicy Bypass %PS_EXTRA% -File "%SCRIPT_PS1%" -AutoRun >> "%LAUNCH_LOG%"
223-
powershell -NoProfile -ExecutionPolicy Bypass %PS_EXTRA% -File "%SCRIPT_PS1%" -AutoRun
214+
powershell.exe -NoProfile -ExecutionPolicy Bypass %PS_EXTRA% -File "%SCRIPT_PS1%" -AutoRun
224215
echo.
225216
if errorlevel 1 (
226217
echo [ERROR] Tests failed (code: %errorlevel%)
@@ -739,16 +730,4 @@ echo - SystemTest_Detailed_*.txt (full output)
739730
echo - energy-report.html (if power test ran)
740731
echo.
741732
pause
742-
exit /b 0
743-
if not exist "%SCRIPT_PS1%" (
744-
echo [ERROR] PowerShell script not found at: %SCRIPT_PS1%
745-
if "%ST_DEBUG%"=="1" >> "%LAUNCH_LOG%" echo [%DATE% %TIME%] ERROR: PS1 missing at "%SCRIPT_PS1%"
746-
pause
747-
goto MENU
748-
)
749-
if not exist "%SCRIPT_PS1%" (
750-
echo [ERROR] PowerShell script not found at: %SCRIPT_PS1%
751-
if "%ST_DEBUG%"=="1" >> "%LAUNCH_LOG%" echo [%DATE% %TIME%] ERROR: PS1 missing at "%SCRIPT_PS1%"
752-
pause
753-
goto MENU
754-
)
733+
exit /b 0

SystemTester.ps1

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1811,10 +1811,11 @@ if ($MyInvocation.InvocationName -ne '.') {
18111811
try {
18121812
Write-Host "Starting Sysinternals Tester v$script:VERSION..." -ForegroundColor Green
18131813

1814-
if (!(Initialize-Environment)) {
1815-
Write-Host "`nSetup required." -ForegroundColor Red
1816-
Read-Host "Press Enter to exit"
1817-
exit 1
1814+
$envReady = Initialize-Environment
1815+
if (!$envReady) {
1816+
Write-Host "`nWARNING: Tools missing - limited functionality" -ForegroundColor Yellow
1817+
Write-Host "Use menu to download Sysinternals tools" -ForegroundColor Yellow
1818+
Start-Sleep -Seconds 2
18181819
}
18191820

18201821
if ($AutoRun) {
@@ -1846,4 +1847,4 @@ if ($MyInvocation.InvocationName -ne '.') {
18461847
finally {
18471848
Write-Host "Thank you for using Sysinternals Tester v$script:VERSION!" -ForegroundColor Cyan
18481849
}
1849-
}
1850+
}

0 commit comments

Comments
 (0)