首页 > 解决方案 > 使用批处理语言 CMD 循环检查 chrome 是否仍在工作

问题描述

我有一项任务要做,需要一些 chrome 配置文件保持启动并且永远不会关闭它们,问题是有时 chrome 应用程序可能会崩溃,导致关闭我打开的所有配置文件我计算持续时间约为 4 天,我考虑过使用 cmd 创建一个循环来检查 chrome 进程是否仍然启动,如果没有,它会再次打开配置文件,就像在 Linux 中我们可以使用终端打开某个进程然后我们不能关闭该进程,除非我们关闭终端控制台,我是批处理语言的新手,我在这里做了什么:

@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
)

老实说,我不知道我在做什么。

标签: google-chromebatch-filecmd

解决方案


推荐阅读