Can I ask for your help? Working on a AHK project where I need to change the current folder in Windows Explorer, I found various methods to achieve this.

Some of them were not working on my system. For one, I found that the language version of my Windows 7 was in cause. Namely, the Alt-D shortcut to focus on the address bar in Windows Explorer is known to be buggy in French locale.

With the help of chaz and using a script from rbrtryn on the old forum, I scripted various approaches to change the folder. One of them (from rbtryn) was coded specifically for WinXP (but, on my XP system, all methods work equally well).

You will find it in the script below with some debugging code. If you have 5 minutes, could you run this piece of code and paste the resulting log file (5 lines) in this thread? This will help identify the most reliable options. Special request to users of other language versions than English: you can help find if other locale has problem with the Alt-D shortcut.

Info("One last test? We will test if changing folder in Dialog box works well on your system.`n`nThe script will run Notepad and open the ""Open"" dialog box.")run, Notepad,,, strPIDSleep,500; long delay for safetySend,^ostrFolder :="C:\"Info("In the next step, the file list in the dialog box should change to your """. strFolder .""" folder.")ControlFocus, Edit1, AControlGetText, strOldText, Edit1, AControlSetText, Edit1,%strFolder%, AControlSend, Edit1,{Enter}, AControlSetText, Edit1,%strOldText%, ACheckResult("Notepad_ControlSend","Is your file list now showing your """. strFolder .""" folder?")Info("Thank you. The script will now close Notepad.")Send, !{F4}Sleep,500; long delay for safetyWinActivate, ahk_pid %strPID%Sleep,500; long delay for safetySend, !{F4}

FileDelete,%strLogFile%FileAppend,%strLog%,%strLogFile%Info("Log saved to """. strLogFile .""". This file will now be opened in Notepad and DELETED from your A_Temp folder.`n`nPlease post the content of this file to the forum thread. Thank you for your help!")run, Notepad %strLogFile%,,, strPIDWinActivate, ahk_pid %strPID%sleep,1000FileDelete,%strLogFile%return

Here you go. But I should say, that I have QTTabBar (http://sourceforge.net/projects/qttabbar/) installed on my system which changes the explorer a bit (multiple tabs etc.). Don't know if it makes a difference in this case...

Thank you gregster. In theory ControlSend would be the best solution but, in real life, I found it less reliable with Explorer. However, I never had problem with ControlSend in standard Dialog boxes as you did (not consistently). I also take note that Alt-D did not work with your German Windows (0407).

Hi JnLInd,well, it wasn't really surprising to me that Alt-D didn't work on my german Vista version, because this key combo is reserved in most german language program versions for the main application menu, called 'Datei' (I think, it's called 'File' in english apps). I don't know any replacement for that hotkey, either, on german windows.

But there seems to be some problem with your test script on my windows version, anyway.The last two methods might be affected by the Alt-D method going rogue. My last run showed:

But... in this case the Alt-D method made my Explorer window disappear completely (probably closed, not sure yet, 'Alt-D' and then 'c' would close the explorer on german windows ). So, there was no explorer window anyway, when the Explorer_CtrlSend method was used this time (this happens on most runs). The explorer now came back for the Notepad_ControlSend method. I will try to take a closer look this evening - I might have to take out the Alt-D method for good results with the last two methods.Still, there might be an issue with the mentioned explorer extension, but I suspect the Alt-D...

FYI, a few years ago, I developed a system which navigates to specified folders in Windows explorer, My Computer, standard dialog boxes (class #32770), and even in some not-standard dialog boxes.

It's called Navigator and it's part of Radial menu v4. By default, it's activated by dragging up with RButton.If you want, I can extract relevant code from Radial menu which runs Navigator component and post it here.

Very interesting. If I understand well, you would replace the part of this code related to Explorer (ExploreWClass,CabinetWClass) with Explorer_Navigate. But the rest is still the best way you found for Dialog boxes. BTW, it looks like you put many hours of trial/error on this! Thanks for sharing

If I understand well, you would replace the part of this code related to Explorer (ExploreWClass,CabinetWClass) with Explorer_Navigate

Yes.

looks like you put many hours of trial/error on this! Thanks for sharing

True. Thanks.

have you tested this with Win_8

I don't have opportunity to test anything on Win_8. Do you have opportunity to do tests on Win_8?

* * *

I'm currently upgrading this "Navigator system". It will now use "Explorer_Shell" method and won't depend on "if A_OSVersion in WIN_8,WIN_7,WIN_VISTA".It will be probably finished tomorrow and I'll post it here for testing...

I have Windows 8 installed on my computer alongside Windows 7, but I never use it. I prefer Windows 7, and it's such a pain to close all my programmes and switch OSs. Unfortunately, I have no time to run the test right now since I already expect to be up all night finishing an assignment... ooh, I hate procrastination... my fault. Maybe in a few days.