Page 4 of 4

Re: 4 options to change the current folder in Windows Explorer

Posted: 26 Jul 2017, 15:51
by JnLlnd
Thanks for the references, jeeswg. I used Navigate2 with an integer parameter (for example 17 = My Computer) but I did not know about object parameters. Interesting.

Re: 4 options to change the current folder in Windows Explor

Posted: 03 Apr 2018, 13:59
by Eureka
Just registered to say THANK YOU!! for all this fundamental research you all have done.
Very valuable, as I''m writing my first AHK (to navigate to folders using Everything, a very reliable and fast file/folder search utility). This thread helps enormously with that :)

BTW:
Unfortunately, there does not seem to be a solution to this:

Code: Select all

For pExp in ComObjCreate("Shell.Application").Windows
    if (pExp.hwnd = strWinId)
        try pExp.Navigate(myPath)
This will fail if myPath includes a hash (# as in C:\C#Projects).
No (longer?) such problems with AHK 1.1.27.07 @ Win10 1709 (both x64)

Re: 4 options to change the current folder in Windows Explorer

Posted: 03 Apr 2018, 16:44
by JnLlnd
Hi Eureka,

Please read this post and the following:
https://autohotkey.com/boards/viewtopic ... 199#p25199

For me, it still does not work if there is a slash after the hash. My message and example should have been: "This will fail if myPath includes a hash and has a slash after it (as in C:\C#Projects\)."

Re: 4 options to change the current folder in Windows Explorer

Posted: 03 Apr 2018, 17:50
by Eureka
Hi Eureka,

Please read this post and the following:
https://autohotkey.com/boards/viewtopic ... 199#p25199

For me, it still does not work if there is a slash after the hash. My message and example should have been: "This will fail if myPath includes a hash and has a slash after it (as in C:\C#Projects\)."
Ah, I see. Same here ...
That's probably because this method uses the URL syntax. And a hash/pound/number sign has special meaning in that case.
I tried to replace it with it's URL escape character: %23 (*), but in that case the % was replaced by it's URL escape character (%25).
It should be possible to feed a literal % by escaping it in AHK, but I'm not (yet) experienced enough in AHK to get that working.


(*) Drag the foldername to the address bar of your browser to see the converted filename