Close all firefox tabs with BATCH

batch-file, taskkill, tasklist

Solution

:loop 
tasklist /fi "imagename eq firefox.exe" | find "firefox.exe" >nul && ( taskkill /im firefox.exe >nul & goto loop )

Get list of tasks, and if `firefox.exe` included in it, then kill it and goto loop

Problem

I try to close all firefox if there are more than one. I want to do loop that check the firefox process and close and check again until there is no any firefox process. This is my code: ``` :loop taskkill /im "firefox.exe" tasklist /fi "imagename eq firefox.exe" goto loop ``` Where is my wrong in this command ? Any help is appreciated.

Original source