Why can Windows Run window run commands not in PATH?

Why can Windows Run window run commands not in PATH?

In a cmd window, if I type chrome, I get the below message because chrome is not in my PATH.

'chrome' is not recognized as an internal or external command,
operable program or batch file.

But if in the Run window (win + R), I type chrome, chrome will run.

Why is this happening? How does Run find the application?

答え1

The run box uses all the app paths in this key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths

command prompt can only find things in the environmental path.

To add chrome to path, you would:

  1. Open File Explorer, right click This PC and choose Properties.
  2. On the left, click Advanced System Settings
  3. On the Advanced tab, choose Environmental Variables.
  4. Edit path under the system variables section add c:\program files\chrome\chrome.exe or wherever it is

関連情報