- Current working directory
- Windows system directory (use GetSystemDirectory() to obtain it)
- Windows directory (use GetWindowsDirectory() to obtain it)
- Directories listed in PATH environment variable
If name does not contains file extension (for example notepad or attrib), Windows will use glob "name.*" to find file with extension that is listed in PATHEXT environment variable.
It's okay if you need just to run notepad or mspaint from command line. But what if you need to execute some program many times? Well, running it by its name is definitely not your choice. I'll try to explain why.