Monday, 19 March, 2001
Windows Command Line Frustration
After working at the Linux command line over the weekend, I found myself frustrated at the Windows command line last night. The source of my frustration: Windows' seeming lack of symbolic links.
I installed TextPad on my Windows system over the weekend and wanted to use it from the command line, but didn't want to add another long path to my PATH environment variable. What to do? I came up with a convoluted method of creating pseudo link files before somebody pointed out to me that Windows does have links. A desktop shortcut is just a link (it even has the extension .lnk) to the real file. I created a link to TextPad, copied it to my c:\util directory (which is in the PATH), and was able to bring up TextPad by typing "textpad.lnk" at the command line. Only two problems.
First, who wants to type '.lnk'. Why can't I just type "textpad"? This turned out to be very simple. If you add ".LNK" to the list of file extensions in your PATHEXT environment variable, then Windows will treat link files as executables. The other problem is that there's no command line program (at least I couldn't find one on the system) that will create a link file. Sure, there's a GUI way to do it, but some things are easier at the command line. So I wrote one. This, too, turned out to be fairly easy. Granted, Windows' links aren't the same as Unix-style symbolic links, but they work very well for starting programs.
Is Windows brain damaged because it doesn't support Unix-style symbolic links? I don't think so. Are Linux shells brain damaged because they don't support file type associations? Windows targets an entirely different type of user than does Linux. Most Windows users never see the command line, and neither want nor need the capabilities I was looking for. Once I realized that Windows' shortcuts could be executed, it was a matter of just a few minutes to set the environment variables and create a link building program. I suspect that it'd be much more difficult to add file type associations to a shell, or to the Linux kernel.