google-chrome - 使用批处理语言 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
)
老实说,我不知道我在做什么。
解决方案
推荐阅读
- sql - 太多参数传递给存储过程存储图像
- php - 特定值foreach循环PHP中每个第一个元素的文本
- azure - 在同一用户故事下批量分配 ADO 任务
- r - 在具有历史变化的数据集中在给定日期查找值的有效 tidyverse 方法
- r - 如何在同一横向页面上添加具有多列的灵活表和文本
- linq - 如何在 Cosmos DB SDK v3 中使用 LINQ 调用 UDF?
- mysql - 如果满足条件,则将列的总和分配给另一列中的一个日期
- r - 出了点问题;缺少所有 RMSE 度量值;使用插入符号训练功能
- java - 可完成的未来未取消但已完成
- robotframework - 如果 Robot 框架中不存在,如何创建新的环境变量?