Capturing the current Explorer window's full path Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
JBensimon
Posts: 118
Joined: 19 Nov 2017, 11:19

Capturing the current Explorer window's full path

12 Mar 2024, 16:22

In Windows 10, capturing the full path to the folder displayed in the active Explorer window was as easy as getting the text content of its address bar using

Code: Select all

ControlGetText, var, ToolbarWindow323, A
which returned something like say Address: C:\Program Files\Common Files, independently of Explorer's "Display the full path in the title bar" setting. But now in Windows 11, the address bar is a godawful (apparently unreadable) "Microsoft.UI.Content.DesktopChildSiteBridge" control and

Code: Select all

ControlGetText, var, Microsoft.UI.Content.DesktopChildSiteBridge1, A
returns an empty string (Window Spy confirms there's no retrievable text there). I've also confirmed that no control in an Explorer window, whether visible or hidden, contains the folder's full path. Getting the window's title text via WinGetTitle does provide the folder's path, but only if "Display the full path in the title bar" is enabled, which can't be counted on.

Does any other approach come to mind to reliably capture the full path of the folder displayed in the current Explorer window?

Thanks.

JB
JBensimon
Posts: 118
Joined: 19 Nov 2017, 11:19

Re: Capturing the current Explorer window's full path

12 Mar 2024, 16:37

That looks great. Crossing my fingers that it still works in Windows 11 (I'll post once I know).

Thanks a LOT for the quick reply!

JB

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot] and 93 guests