Batch file checking firefox is open? -
i want write batch file keep checking every 20 seconds if firefox open, if open there no action required. if firefox closed, batch file needs force open on webpage. needs silent batch..
i've tried far:
@echo off set wshshell = wscript.createobject("wscript.shell") tasklist /fi "firefox.exe" 2>nul | find /i /n "firefox.exe">nul if %errorlevel%==1 goto nofirefox cmd /c start firefox.exe -new-tab "google.com"
your code lazy (and vbscript line blowing mind), see you're going it. tasklist
command missing bit. tasklist /fi "imagename eq firefox.exe"
search task list firefox. need loop tag ping 20 second delay.
try this.
@echo off setlocal :loop wmic process name="firefox.exe" name /format:list 2>nul | find /i "firefox" >nul || call :relaunch ping -n 21 0.0.0.0>nul goto loop :relaunch rem echo %time% - starting firefox start "" firefox.exe -new-tab http://www.google.com/
Comments
Post a Comment