-1

When I try to start a program with start command without specifying path, for some programs it works and for some programs it doesn't work.

I know that if those programs are in my PATH list or in current directory, I don't have to type the path.

But start command works for some programs even if those aren't in current directory or in my PATH list. What is the reason for this?

sakibmoon
  • 145

1 Answers1

2

It searches the App Paths registry key.

Finding an Application Executable

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 file is sought in the following locations:

  • 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
grawity
  • 501,077