When I type anything in Run dialog box (winword for example), in which path it generally looks for the exe that we want to run?
Location searched for exe in Run Dialog
1 min read
It is determined by the PATH environment variable.
Bring up a CMD prompt screen and type SET; scroll down and look for PATH=
When executing an EXE file, Windows goes down the folders (directories) 1-by-1 as listed in PATH until it finds the EXE file.
PATH from the system I am currently on:
Path=C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;c:\python27;C:\Program Files\Debugging Tools for Windows (x64); K:\WinDDK\7600.16385.1\Debuggers;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\MySQL\MySQL Server 5.5\bin;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\WindowsPowerShell\v1.0\
Regards. . .
jcgriff2
There is more to it than that I think.
As long as there is a subkey for the program under this registry key, it can be launched from the Run box.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths
The Command Prompt relies on entries in the Path Environmental Variable. Enter Path in a Command Prompt window to see what those entries are.Found here: http://forum.soft32.com/windows/Start-Run-Command-Prompt-ftopict353085.html — no longer valid, sorry.
To query this key and look at the results, try this from the Run box or Command prompt (all on one line):
cmd /c reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths" /s > app_paths.txt & notepad app_paths.txt & del app_paths.txt
Thanks ZTrucker and jcgriff2 for the answers. So basically, what I understood from your answers:
Suppose I type abc in run dialog box. It looks for abc.exe in the paths set in Path Environment Variable. If it is present in any of the path, then it launches abc.exe
Additionally, it checks if there is subkey for the abc program under the following Registry Key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths
If it finds the subkey, then it launches the corresponding program
Please let me know if I am incorrect.
Ask AI
AI can make mistakes. Check the cited posts. Archived advice can be out-of-date
Don't include personal information. Questions and selected public posts go to OpenAI. About Ask AI