5

This may not be the best place to post this, but my question is asking the sort of the opposite of What is the Linux equivalent to Windows' Program Files? .

I'm new to windows and am used to the unix style file system, where there are designated folders for certain types of files. I'm wondering what the normal way to install programs is in windows, specifically ones that will be started from the cmd prompt.

So far, I have been adding user environment variables for each program, and appending this variable to the PATH. So, for gvim, I would add

GVIM_HOME

and then append to my path:

%PATH%;%GVIM_HOME%

But now I'm wondering if I should just create a folder and add it to the path, and then put shortcuts to my exe's into that folder. Do any of you know the usual way this is done?

2
  • 2
    This is better suited here: SuperUser Dec 19, 2012 at 20:44
  • MY FINAL ANSWER: In my windows days, I had C:\Windows\Command as the standalone exe directory. Using batch files if they had to run an executable that was senstive to it's starting point, and, sysinternal's <a href="technet.microsoft.com/en-us/sysinternals/…> can make links. The "mklink.exe" for "newer" versions of windows (8, server2012, etc). Or you can use wscript to <a href="ss64.com/vb/shortcut.html">create .lnk files if needed.</a>. Using cygwin though is like using dosbox for linux, kinda pointless. That's my answer and I'm sticking with it! Jul 17, 2015 at 10:15

2 Answers 2

6

It's very interesting to know that you started out with Unix :-)

Generally, in Windows directories/folders are not organised with the same idea as they are in Unix/Linux. I normally have a "System" partition where I install Windows itself and my applications, and a "Data" partition where I keep my own data. In Post-XP Windows, this may be a bit tricky to accomplish but anything you open and close yourself can be stored in Data partition.

Back to the System partition, the default install location for any programs is "C:/Program Files" or something else that the installers will figure out itself. Under "Program Files" binaries, documentations and all supporting files are there for the programs to run. But for programs like GVIM, I would suggest you put it under C:/ and use path without spaces. And then you update %PATH. That's how I install Perl and other pure commandline tools which are more popular in Unix world. Or to be more organised you can create a folder like C:/cmdtools and put programs you install manually there.

2

AFAIK there's no "usual way" of doing this, mainly because in the (non-server) Windows world, programs are designed to be run via the UI. But I just checked the %PATH% variable of a nearby Windows box and it has a zillion different paths in it, so that's probably the most common behavior.

It's also a good idea because Windows shortcuts don't work quite like *nix soft symlinks. They're actual files on disk (.lnk), not references to other locations on the filesystem. You can have a directory full of shortcuts, and you can invoke them from inside cmd.exe (e.g., c:\>program.lnk will run c:\foo\program.exe), but each shortcut has a parameter which tells c:\foo\program.exe the directory in which it's to begin its execution. It's not like $PWD or /proc/[pid]/cwd in *nix. It's pretty important to not mess up, because it affects things like DLL loading.

(also, having to call foo.lnk from the CLI instead of just foo seems kind of klunky to me.)

this is my experience on XP Pro anyway. YMMV with newer versions of Windows and command shells.

Not the answer you're looking for? Browse other questions tagged .