La séance de questions et réponses d’aujourd’hui nous est offerte par SuperUser, une sous-division de Stack Exchange, un groupe de sites Web de questions-réponses dirigé par la communauté.
La question
Le lecteur superutilisateur mt025 veut savoir comment la boîte de dialogue Exécuter sait où se trouvent les applications qui ne se trouvent pas dans le chemin système de Windows:
As a power user, I frequently use the Run Dialog. I can understand why the following commands work, as they are in the PATH environment variable.
- mspaint
- diskmgmt.msc
- explorer
These commands also work in CMD.
The commands below work in the Run Dialog, but they are not in the PATH environment variable, and they do not work in CMD.
- firefox
- winword
- iexplore
How does Run know where these files are?
La réponse
Le contributeur SuperUser w32sh a la solution pour nous:
When you execute a command from the Run Dialog, the system looks at the App Paths registry keys here:
HKEY_CURRENT_USERSOFTWAREMicrosoftWindowsCurrentVersionApp Paths
and
HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionApp Paths
Example
HKEY_CURRENT_USERSOFTWAREMicrosoftWindowsCurrentVersionApp Pathsfilezilla.exe
(Default) value data has the full path to the executable. If it is not found, it looks at each folder included in the PATH, whereas CMD (the Command Prompt) does not reference these registry keys, it only searches the PATH.
Avez-vous quelque chose à ajouter à l'explication? Sound off dans les commentaires. Voulez-vous lire plus de réponses d'autres utilisateurs de Stack Exchange doués en technologie? Découvrez le fil de discussion complet ici.