Tab completion in Windows NT & 2000

For the souls that balk at using such a user-friendly piece of software as Tweak UI, here's the way to enable tab completion on your Windows NT or 2000 box using direct registry editing. If you don't know how to edit the registry directly I recommend you do get Tweak UI and not muck about in this database from hell thought up by the folks at Redmond.

So, open up your favorite registry editor and go to HKEY_LOCAL_MACHINE for a system-wide implementation or HKEY_CURRENT_USER for a per user implementation. Note that the per user setting takes precedence.

Then go to

      /Software/Microsoft/Command Processor

If there is already a key named CompletionChar then just change the value for the key to whatever you want. See below for possible values. If the key is not yet in existence, then add a value of REG_DWORD named CompletionChar and set the value.

Now, for Windows NT you're done (well, not exactly: you need to reboot).

Windows 2000 recognizes another key named PathCompletionChar, also a REG_DWORD. This would apparently enable path completion, with the value for CompletionChar enabling filename completion. So what's the difference? I don't know and frankly don't care. I have set both of these keys to 9, which put the completion under the trusty TAB key. I have enough trouble remembering not to use / when CD'ing under Windows.

Possible values

A value of 0 or the absence of the key turns off completion completely.
A value in the range of 0x1 to 0x1F sets completion to the ASCII control character of that value. Use 9 for the TAB key.

Differences with Linux

When you press the file or path completion, the first matching entry appears. So, no list. Pressing it again retrieves the next entry in the list. To go backwards, press SHIFT-{completion-character}.

Using completion only once (why?)

You get the ability to enable completion on a per use basis under Windows 2000. Just add the switch '/F:ON' when using CMD. This sets the completion chars to CTRL-F for filename completion and CTRL-D for path completion, so I don't really know what use this could be.


Sources:
http://www.jsiinc.com/reghack.htm

April 26, 2001