获取所有打开的资源管理器窗口的报告 [英] get report of all open explorer windows

查看:96
本文介绍了获取所有打开的资源管理器窗口的报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获得所有打开的资源管理器窗口标题和当前路径的报告.当前路径部分是问题,可以使用C#在此处回答,但是我想要这个用于powershell,并且不确定如何适应它. 我不确定如何显示其中的窗口标题部分.

I want to get a report of all open explorer windows titles and current paths. The current paths part of this is problem is answered here with C#, but I want this for powershell and am not sure how to adapt it. I am not sure how to bring out the window titles part of it.

有人可以帮忙吗?

推荐答案

听起来像是您在寻找这样的东西:

Sounds to me like you're looking for something like this:

$app = New-Object -COM 'Shell.Application'
$app.Windows() | Select-Object LocationURL

AFAICS窗口对象没有标题属性,但是您可以从

AFAICS the window objects don't have a title property, but you can get that information from Get-Process via the window handle ID:

function Get-WindowTitle($handle) {
  Get-Process |
    Where-Object { $_.MainWindowHandle -eq $handle } |
    Select-Object -Expand MainWindowTitle
}

$app = New-Object -COM 'Shell.Application'
$app.Windows() |
  Select-Object LocationURL, @{n='Title';e={Get-WindowTitle $_.HWND}}

这篇关于获取所有打开的资源管理器窗口的报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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