At first, I thought that cmd only looks for executables in the directories contained in the PATH variable, so I randomly picked an application - winword.exe (Microsoft Word) and tried to launch it from the command line:
O motivo winword.exe
funcionou é que existe uma chave do registro que definiu o caminho para o Microsoft Word (Winword.exe). Uma chave semelhante existe para o Firefox.exe e Chrome.exe se esses aplicativos estiverem instalados.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths
What I want to know is where exactly does the command prompt look for executables?
Variável PATH do sistema, Variável PATH do usuário e as várias chaves em ..\App Paths
. Consegui confirmar que o Audacity não cria uma chave para si mesmo quando é instalado.
When the ShellExecuteEx function is called with the name of an executable file in its lpFile parameter, there are several places where the function looks for the file. We recommend registering your application in the App Paths registry subkey. Doing so avoids the need for applications to modify the system PATH environment variable.
- The current working directory.
- The Windows directory only (no subdirectories are searched).
- The Windows\System32 directory.
- Directories listed in the PATH environment variable.
- Recommended: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths
Fonte: Registro do aplicativo