0

I have a certain task to do which requires some chrome profiles to stay launched and never close them, the problem is sometimes the chrome app may get crashed causing the closing of all the profiles I'm opening I calculated the duration is about 4 days, I thought about making a loop using cmd that checks if the chrome process is still launched or not and if not it opens the profiles again, like in Linux we can open a certain process using Terminal and then we can't close the process unless we closed the terminal console, I'm new at Batch language here what I did:

@echo off
SET /A "index = 1"
SET /A "count = 5"
:while
if %index% leq %count% (
   echo Checking if the chrome is still working...
    rem a command to stay checking the process
    rem if no 
        rem start "name of the shortcut of the profile"
   SET /A "index = index + 1"
   goto :while
)

To be honest I don't know what am I doing.

aschipfl
  • 33,626
  • 12
  • 54
  • 99
  • 1
    https://stackoverflow.com/questions/29673466/detect-whether-web-browser-is-open-or-close-using-batch-file <--- substitute firefox32.exe for chrome.exe. – lww Dec 01 '20 at 16:32
  • I would setup a taskscheduler task for this, and set it to restart failed tasks. Sometimes fixing app crashes, is not an option. There's also a variety of watchdog programs/services out there, that you could use. – jwdonahue Dec 02 '20 at 19:11
  • So what I understood you suggest not to stop crushings? – Ayoub Khadrani Dec 04 '20 at 08:16
  • thank you guys for your help <3 – Ayoub Khadrani Jan 21 '21 at 13:48

0 Answers0