Monday, 20 October 2014

Run box special folders

After reading an answer I learned that certain folders have a special feature
USERPROFILE AKA C:\Users\Steven
SystemRoot  AKA C:\Windows
From the Run box, you can access any subfolders of these. For example entering Documents will bring up C:\Users\Steven\Documents. Do any other folders have this feature, or can this feature be added to a folder?


Ans )  Windows Run box attempts to invoke Shell.ShellExecute method (default operation of registered file type) for file specified by text in the input field, namely in the current directory, which is %USERPROFILE%!
Suppose we write MyLoc Sets here and hit Enter.
At first, the word MyLoc supposed to be a command. The shell searches for an executable variant, e.g. MyLoc.com, MyLoc.exe, MyLoc.bat, MyLoc.cmd, ... in the current directory, then in directories specified by the %PATH% environmental variable, then for \SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Myloc.exe registry key under HKEY_CURRENT_USER and HKEY_LOCAL_MACHINE hives. As a last resort, the shell searches for MyLoc Sets folder in the same locations (except of the registry). File not found error...
And now, try Local Settings: found no executable named Local, but found a folder of this name under %USERPROFILE%! Thus, as a folder is registered file type, and the default operation for a folder used to be "Explore", then it can be performed by the ShellExecute method...

No comments:

Post a Comment