Ok, time for the first post with meat!
So, we installed Windows NT 4.0 on our machine. A nice and stable operating system. But, when being used to UNIX systems, one thing is particularly anoying: The shell, or the command processor (in Microsoft lingo). I guess it was because Windows was supposed to be an end user operating system, this important piece of software got little love before the PowerShell age. Though the NT version ('cmd'exe') improved a little over its DOS predecessor (the infamous 'command.com'), it is still far behind even the oldest korn shell you can remember.
It is so not surprising that I started improving the command line user experience right after installation. And boy, there is a lot to improve!
Let's start with auto completion: Nothing speeds up the command line user more than auto completion. I really cannot imagine why, of all features, Microsoft didn't enable this by default. This feauture was there all the years, stable and performant, but it remained disabled by default until Windows XP! But since it is already there, we can enable it by setting the DWORD regeistry value
Code:
HKEY_CURRENT_USER\Software\Microsoft\Command Processor\CompletionChar to 9 (decimal)
to enable completion with the TAB key. Oh, how everything feels so much more familiar with this little change! For convenience, I put a .reg file 'CmdAutoCompletion.reg' in the attached tar.gz archive. Just double-click it, and you're set.
So, now that we have fixed this, the next nuisance is the fact that we can not simply switch to another drive by a 'cd' command. Well, too bad, that can't be helped, so better get used to it. But fear not, another registry hack comes to the rescue: Since most of the time this happened to me when I'm opening a default command prompt and wanted it to be in a directory on another drive, I just copied the Windows 10 'Create command prompt here' Explorer extension. That succer puts an entry into the context menu of folders in Windows Explorer. I'll spare you the details, but again, conveniently find 'CmdHereShellExtension.reg' in the tar.gz. Be aware, however, that you will have to taylor the path of 'cmd.exe' to fit your installation. I experimented with the '%SystemRoot% environment variable, but only to find out that Explorer does no variable expansion here. And though it will use the search path, relying on this will lead to unpleasent results, since all paths are given in the good old 8.3, short name 'Progra~1' convention in that case. If you hard-code the path to 'cmd.exe' file, however, long filenames work fine. So just adapt the .reg file with your editor (Notepad, if it can't be helped) before importing it into your registry.
And while we're at it, it would be great - especially when setting up environment variables - to be able to copy a path right out of the Explorer window. Turns out that this feature is missing, however. But here, the C compiler and our L337 programming skills come in handy: I hacked a little tool 'c2c' (short form of 'copy to clipboard') that will handle this situation. By default, it will copy the current directory to the clipboard, when invoked without parameters, so it is even helpful to the humble command line warrior. Copy 'c2c.exe' into your System32 directory, and (again, with a tweaked full path) double-click 'C2CShellExtension.reg'. Now you can copy any path to the clipboard and continue from there.
The last goody in that tar.gz file is 'which.exe'. Although there are some POSIX tools in the Resource Kit, 'which' is missing. My version searches the usual supects in your environment for an executable file matching the parameter. Think of 'which cl' to find the install directory of your C compiler. You'll get best results when it is copied into your 'System32' directory. Having said that, install those POSIX exe's from the ResKit, and you'll feel much more at home.
Hey, suddenly, we have a usable command line interface for our NT box! Pretty cool, eh? And you know what's the best part? Everything here will come with source code! So even if you just read through all of this in envy because your VW 320 is still running on Intel processors, you can just compile the crap yourself with minimal effort. You probably will have to create some Intel configurations, though. But if you run into trouble, I'll assist you.
Ok, enough for today!
Next time, we'll try to bridge the gap between Windows NT 4 and and Windows 2000! Stay tuned!