2

When I open Windows Explorer window from within an application (e.g. Save As, Open, etc.) it opens to the last location that particular handle used. I want it to open to the last location that any handle used.

Note that this is not the same as opening every dialog to a universal default location.

For example, when I am jumping between Adobe Photoshop, Premiere, and After Effects, I have to choose files to import and export within each application, and each combination opens Explorer to the last location that specific function used. This means there are NumApplications×NumDialogs that are opening to the previous directory I used who knows when, that I then have to manually navigate to the new project directory.

How do I stupify Windows Explorer to not retain specific paths per handle?


Currently my workaround is to have a single Explorer window open to the root of my project directory that I keep grabbing the path from the address bar (Alt+D, Ctrl+C), and whenever another handle opens, I paste in that path. This still introduces an extra context switch to my workflow in numerous places.

3
  • You can't. Applications are responsible for setting any default directory locations in their own dialogs. They don't open explorer, they open a dialog.
    – DavidPostill
    Commented Sep 26, 2018 at 21:38
  • 1
    So an application that opens a file select dialog specifies the starting directory itself? Commented Sep 26, 2018 at 22:11
  • Answer added...
    – DavidPostill
    Commented Sep 27, 2018 at 19:32

1 Answer 1

2

I want to open all file select dialogs to last location used (not application specific)

This is not possible as applications are responsible for setting any default directory locations in their own dialogs.

This is done using the Common Item Dialog API, which was implemented in Windows Vista and used in all later Windows versions.

The Common Item Dialog is used by the Open dialog and the Save dialog (which share most of their functionality).

The API uses IFileDialog::SetDefaultFolder to set the default folder location when creating an Open or Save As dialog which is specific to a particular application):

The default folder is the folder in which the dialog starts the first time a user opens it from your application. After that, the dialog will open in the last folder a user opened or the last folder they used to save an item. See State Persistence for more details.

You can force the dialog to always show the same folder when it opens, regardless of previous user action, by calling IFileDialog::SetFolder. However, we do not recommended doing this. If you call SetFolder before you display the dialog box, the most recent location that the user saved to or opened from is not shown. Unless there is a very specific reason for this behavior, it is not a good or expected user experience and should be avoided. In almost all instances, IFileDialog::SetDefaultFolder is the better method.

When saving a document for the first time in the Save dialog, you should follow the same guidelines in determining the initial folder as you did in the Open dialog. If the user is editing a previously existing document, open the dialog in the folder where that document is stored, and populate the edit box with that document's name. Call IFileSaveDialog::SetSaveAsItem with the current item prior to calling Show.

Source Common Item Dialog (Windows).

So it is the responsibility of each individual application to decide how they will handle the default directory set when opening these dialogs.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .