sashadereh sashadereh - 1 month ago 6
Bash Question

Where START command on Windows finds the path to executable

I would like to know where

START
command on Windows finds the path to executable. For example, if I run
START /W python
and have no path to
python.exe
in my
PATH
environment variable it correctly finds the path and runs python. In my system it is
C:\Python27\python.exe
So, how
START
finds the correct path?

P.S.
If I write python via my command prompt (
cmd.exe
) it can not find the path to python.

Thank you!

Answer

When you use the START command from command line or batch file, or when you use the Run dialog, the systems follows the behaviour documented for ShellExecute or ShellExecuteEx API calls.

In general, the application will be searched in:

  1. The current working directory.
  2. The Windows directory.
  3. The Windows\System32 directory.
  4. Directories listed in the PATH environment variable.
  5. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths
  6. HKEY_CLASSES_ROOT\Applications\ApplicationName.exe

For a complete description read Application Registration

Comments