Microsoft Windows 2000
Server Administrator's Companion

by Sharon Crawford & Charlie Russel
copyright (c) 2000 by Microsoft Corporation
all rights reserved


Home
Articles
Utilities
Software

Electronic Book

Command Line Auto-complete

To avoid having to type long file names on the command line, here are a

couple solutions for file and directory name completion:

Solution #1:

Navigate to the following node in the registry:

HKEY_CURRENT_USER\Software\Microsoft\Command Processor

Once there, you'll see a value called CompletionChar.  This should be 0x00000000. Change it to '9' (the tab character).

To use this feature:   cd \prog (and press the tab key)

The command line should display:   cd \program files
Pressing tab again gives you other choices of directory names, if such directories exist.  To demonstrate, go to a root drive and type:    cd(tab)

Solution #2:

As another solution use: cmd /f:on
(see http://www.wugnet.com/wininfo/win2000/showcase/beta3/cli.htm)

However, the file and directory name completion is NOT enabled by default.  You can enable or disable file name completion for a particular invocation of CMD.EXE with the /F:ON or /F:OFF switch.   You can enable or disable completion for all invocations of CMD.EXE on a machine and/or user logon session by setting either or both of the following REG_DWORD values in the registry using REGEDT32.EXE:

HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\CompletionChar
HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\PathCompletionChar

and/or

HKEY_CURRENT_USER\Software\Microsoft\Command Processor\CompletionChar
HKEY_CURRENT_USER\Software\Microsoft\Command Processor\PathCompletionChar

Use the hex value of a control character for a specific function (e.g. 0x4 is Ctrl-D and 0x6 is Ctrl-F).  The user specific settings take precedence over the machine settings. The command line switches take precedence over the registry settings.