gpt4 book ai didi

windows - 任务列表显示所有窗口

转载 作者:可可西里 更新时间:2023-11-01 10:00:29 24 4
gpt4 key购买 nike

我正在运行以下批处理脚本:

@echo off
tasklist /nh /fi "Windowtitle eq Export to PDF - DOORS" | find /i "Export to PDF - DOORS" >nul && (
echo PDF is running
) || (
echo PDF is not running
)

如果窗口当前处于事件状态,这只会回显“PDF 正在运行”。也许我使用了错误的命令(任务列表)。有没有办法在打开的窗口的完整列表中找到?

最佳答案

我能够通过 VB 脚本获得我需要的东西(感谢@JoshGuzman 的想法):

Set Word = CreateObject("Word.Application")
Set Tasks = Word.Tasks

For Each Task in Tasks
If Task.Visible Then
If Task.name = "Export to PDF - DOORS" Then
Wscript.Echo "PDF is Running"
Else
Wscript.Echo "PDF is not Running"
End If
End If
Next

Word.Quit

然后从命令提示符或批处理文件中使用 wscript myScript.vbs 调用 VB 脚本。

关于windows - 任务列表显示所有窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12184041/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com