From 6d0055c7fb6eccdabb0a48693a0e2067f65f362d Mon Sep 17 00:00:00 2001 From: Xiaoyin Liu Date: Fri, 6 Mar 2020 19:18:45 +0800 Subject: [PATCH] Avoid potentially running wrong files in launch.bat Use full path for "timeout.exe", "tasklist.exe" and "findstr.exe", so that even if there are executables with same names in the user's %PATH% directories, we always run the ones from System32. --- Ghidra/RuntimeScripts/Windows/support/launch.bat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Ghidra/RuntimeScripts/Windows/support/launch.bat b/Ghidra/RuntimeScripts/Windows/support/launch.bat index 6f411de4aa..9bee1566cf 100644 --- a/Ghidra/RuntimeScripts/Windows/support/launch.bat +++ b/Ghidra/RuntimeScripts/Windows/support/launch.bat @@ -169,8 +169,8 @@ if "%BACKGROUND%"=="y" ( REM NOTE: The below check isn't perfect because they might have other javaw's running, but REM without the PID of the thing we launched, it's the best we can do (maybe use WMI?). REM Worst case, they just won't see the error message. - timeout /NOBREAK 1 > NUL - tasklist | findstr "javaw" > NUL + %SystemRoot%\System32\timeout.exe /NOBREAK 1 > NUL + %SystemRoot%\System32\tasklist.exe | %SystemRoot%\System32\findstr.exe "javaw" > NUL if not "!ERRORLEVEL!"=="0" ( echo Exited with error. Run in foreground ^(fg^) mode for more details. )