0

As a continuation to this question, can someone explain where the Run dialogue window obtains explorer.exe directory locations that match up with discrete directory names, e.g., "documents", "videos", "downloads", etc? Not to be confused with %path%, or Library versions of these directories. I assumed it would be in registry somewhere, similar to app path (related), but can't seem to find it on my own.

Arctiic
  • 1,298

1 Answers1

1

It doesn't look up directory locations specifically – it really just uses the same %path% lookup procedure for all inputs that don't contain a colon or a (back)slash.

First the input is looked up in your user profile directory, known as %UserProfile%1 and usually located at C:\Users\<name> since Vista. You can run . to quickly open the directory itself.

This isn't limited to built-in directories; the Run dialog will open anything that's a valid filename within the current directory (including files). I believe it just uses ShellExecuteEx() under the hood, which is the standard "open this path like Explorer would" Win32 function.

If there is no match in the current directory, the Run dialog will search %path% for matches. For example, entering "system32" will open "C:\Windows\System32", in the exact same way that entering "notepad" would open "C:\Windows\notepad.exe". It doesn't matter that one is a directory and the other is an executable; the Run dialog just uses the default "shell open" on both.


1 Not to be confused with %HomeDrive%%HomePath%. If your account is customized such that the home location is different from the user profile location, your programs will be started with "home" as their initial directory but the Run dialog will still use the "user profile" directory.

grawity
  • 501,077