使用批处理文件检测Web浏览器是打开还是关闭 [英] detect whether web browser is open or close using batch file

查看:63
本文介绍了使用批处理文件检测Web浏览器是打开还是关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用批处理文件访问我的Web浏览器,是否有办法知道是否使用批处理文件打开了任何Web浏览器?以任何浏览器为例.

I would like to access my web browser using a batch file.Is there a way of knowing whether any web browser is open or not using a batch file? Take any browser for example.

推荐答案

是的,有一种方法.命令 tasklist 返回您正在运行的任务的列表:

Yes, there is a way. The command tasklist returns you a list of running tasks:

@ECHO OFF
SET running=0
FOR /f "tokens=*" %%A IN ('tasklist^ /v^| findstr /i /c:"firefox32.exe"') DO SET running=1
IF %running%==1 ECHO Firefox is running!
PAUSE

这将检查Firefox是否正在运行.

This checks whether Firefox is running.

这篇关于使用批处理文件检测Web浏览器是打开还是关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆