如何使用命令行获取正在运行的应用程序的窗口标题? [英] How to get the window title of running application with command-line?

查看:61
本文介绍了如何使用命令行获取正在运行的应用程序的窗口标题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当应用程序以Windows窗体运行时,它具有称为窗口标题的属性.
该窗口标题显示在应用程序窗口的选项卡中.

When application run in windows form it have property called window title .
This window title appear in the tab of the application windows.

我请求帮助来获取使用命令行运行的应用程序的此窗口标题.

I ask help to get this window title for the application running with command-line.

推荐答案

这是如何获取在命令行中运行 notepad.exe 的Windows标题的示例:

This is example how to get the windows title for running notepad.exe in command line:

tasklist /v /fo list /fi "imagename eq  notepad*"| find /i  "window title:"

或从cmd运行此行

for /f "tokens=* skip=9 delims= " %g in ('tasklist /v /fo list /fi "imagename eq  notepad*"') do @echo %g

如果要从批处理文件运行,则仅将 %g 替换为 %% g

If you like to run from batch file you will only replace %g with %%g

这篇关于如何使用命令行获取正在运行的应用程序的窗口标题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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