I have the following batch file, which uses ADB to monitor device logs and searches for a string:
@ECHO OFF ECHO Starting log monitor... START /B adb.exe logcat > log :LOOP (TYPE log | FIND "string to find") > NUL IF "%errorlevel%" == "1" GOTO LOOP :END ECHO String found!
The script starts the
logcat command, which runs asynchronously and in the background, using
After the string is found, I would like to end the asynchronous
logcat command, as it is no longer needed.
Is there any way of the main script telling the asynchronous script to end?
I know that I could technically use
adb.exe kill-server or
taskkill /F /IM adb.exe to end all ADB processes, but I need to only end the
logcat command and continue running all other instances of ADB.