Windows – Why is there no /usr/bin in Windows

installationpathwindows

I am a Linux user spending some time in Windows and I am trying to understand
some of the Windows paradigms instead of fighting them. I notice that each
program installed in the traditional manner adds the executables to

C:\Program Files

and then adds a shortcut to the Desktop / Start Menu containing the entire path.
However, there is no common directory with links to the software, i.e.
C:\bin\bar.exe which would link to

C:\Program Files\foo\bar.exe

Therefore, after installing an application the only way to use the application
is via the menus or by navigating to the executable in the filesystem. One
cannot simply Win-R to open the run dialogue and then type bar or bar.exe
as is possible with notepad or mspaint. I realize that Windows 8 improves on
this with the otherwise horrendous Start Screen which does support typing the
name of the app, but again this depends on the app having registered itself for
such.

Would I be doing any harm by adding C:\Program Files recursively to the
Windows path? I do realize that there will be name collisions (i.e.
uninstall.exe) but could there be other issues?

Best Answer

Usually there should not be any issues. However, you need to watch out for two things:

  • Avoid name collisions. In particular, make sure the standard path components (like C:\windows etc.) come first, so no system utility is hidden in the path.
  • The PATH variable may not contain more than 8191 characters. So if you have many program folders that you want to add, you may have to pick and choose. If you assume an average path length of 50 characters per program, that gives you space for about 160 programs in the PATH.

The reason this is not done by default is probably simply that the command line is used relatively rarely on Windows, so there was never a pressing need to have everything in the path. Most programs that need to invoke other programs have adapted to this, and use the full path for invocations.

Finally, if you would like to work on the command line a lot, like on Linux, I recommend you install Cygwin. It provides a Linux-like environment on Windows, and lets you work on the command line. It also maintains its own PATH variable, which you can customize without impacting other Windows applications.