Friday, September 01, 2006

DOS Auto Complete Path And Filename

Enable MS-DOS faster change path and auto-complete filename are the main attractions to use Windows command line utilities!

The fastest and easiest way to change path in MS-DOS or open MS-DOS prompt at indicated path dynamically is by adding tweaked MS-DOS shortcut to Windows context menu. Coupled with MS-DOS's filename auto-completion, it is easier to use various Windows command line utilities such as compiling program source code with command line compilers of C, .Net, Java, etc.

Enlarge picture...
Enlarge picture...
MS-DOS of Windows XP featured with filename auto-completion. Just press TAB key and the MS-DOS will automatically lists the file's name in the current directory. If initial character(s) is typed then only follow by pressing TAB key, it will only lists out those file's name with matching initial characters. MS-DOS of Windows 2000 able to auto complete filename by pressing TAB key too. Although, this feature is not turned on by default!

Turn on Windows 2000 MS-DOS's filename auto-completion feature:

  1. Click the Windows's Start button,
  2. Click the Run menu,
  3. Type regedit.exe in the Open field to call up Windows Registry Editor,
  4. Go to HKEY_CURRENT_USER\Software\Microsoft\Command Processor
  5. Set the value of CompletionChar to 9.
  6. Done. Open MS-DOS, or better known as Command Prompt, to test the result. Now, the MS-DOS should automatically lists the filename each time pressing the TAB key. If initial character(s) is typed then only follow by pressing TAB key, the MS-DOS should automatically lists only file's name that matches with the initial character(s) given. Note, pressing SHIFT+TAB will tell the MS-DOS listing backward.
Add tweaked MS-DOS shortcut to Windows context menu:

Enlarge picture...
  1. Open My Computer or Windows Explorer,
  2. Click the Tools menu,
  3. Select Folder Options,
  4. Click on File Types tab,
  5. Search for "Folder" file type and highlight it,
  6. Click the Advanced button,
  7. Click the New button,
  8. Type a meaningful name, say Open DOS, in the Action field,
  9. Type C:\WINNT\system32\CMD.EXE /k cd %1 in the Application Used To Perform Action field below the Action field,
  10. Click OK button all the way to complete the procedures.
  11. To test the result, right click on any folder in local or network drives (not network folders which are not mapped as network drive). The Windows context menu should has new command shortcut named as Open Dos (the name given in previous step). Click on the Open DOS, the MS-DOS windows (titled as Command Prompt) opened up with the DOS current directory as the folder being right-clicked!

This article has 3 comments.

Nagarajan said...

The article is really nice and the best but we need more information and the related topics better have some more related to topica and the way you explain is very easier pls keep it up
thanx

sashiman said...

Thank you for both of these tips. Unfortunately, the second backfired, because like an idiot I didn't check my path (for me it should have been windows and not WINNT). Strangely, once I entered the new action for the contextual menu, I could no longer modify or delete it. So now I have OpenDOS and OpenDOSii on my contextual menu, with only the latter working!

Also, for the first tip regarding the registry edit for autocomplete filename, I had to chose "decimal" rather than "hex" to enter the 9. A bit mystifying, as obviously they represent the same number. Perhaps Hex requires preceding zeroes?

bloggerdigest said...

Hi Sashiman, you may delete the wrong the context menu by searching the 'name' in Registry

E.g. you may find them here in Windows XP Pro:

HK_CLASSES_ROOT\FOLDER\SHELL\