Skip to content

Instantly share code, notes, and snippets.

@hanikhan
Created July 30, 2018 13:48
Show Gist options
  • Save hanikhan/5a837dca2d318b97cd67a38f1034a1dc to your computer and use it in GitHub Desktop.
Save hanikhan/5a837dca2d318b97cd67a38f1034a1dc to your computer and use it in GitHub Desktop.
Log BrowserStackLocal process details to a log file using bat file on Windows system
@ECHO OFF
REM Run this bat file from Windows Command Prompt in the following format: name_of_bat interval_for_logging. Example: logging 10
REM Checking if argument specified for the command is valid
SET "var="&for /f "delims=0123456789" %%i in ("%1") do set var=%%i
if defined var (goto :end) else (goto :start)
:start
echo Hit Ctrl+C to stop logging!
:loop
<nul set /p "=%time% " >>bslocal.log
tasklist|find /i "BrowserStack" >>bslocal.log
REM For any MS-DOS or Windows version with a TCP/IP client, PING can be used to delay execution for a number of seconds
ping localhost -n %1 >NUL
goto :loop
:end
echo Invalid argument Stopping bat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment