New article on PowerShell Magazine: Use Shell.Application to determine which folder is open in File Explorer

Explorer

To determine which Windows are currently open in Explorer the Shell.Application Com Object can be used. Specifically the Windows() method of this object. It can retrieve the open Windows of both explorer as well as Internet Explorer. The full article  is available on PowerShell Magazine : Use Shell.Application to determine which folder is open in File Explorer

1
2
3
$ShellApp = New-Object -ComObject Shell.Application
$ShellApp.Windows() | Where-Object {$_.Name -eq 'File Explorer'} | 
Select-Object LocationName,LocationURL

For more articles like this, have a look at the External Articles section of my blog, it contains all the articles I have posted on external sources such as PowerShell Magazine.

Links in this Article
PSTip: Use Shell.Application to determine which folder is open in File Explorer
PowerShell Magazine
External Articles
Share

Leave a Reply

Your email address will not be published.