««Jan 2009»»
SMTWTFS
     123
45678910
11121314151617
18192021222324
25262728293031

Search TipicalCharlie

 


Most Popular Tags

   

Blog Status

  • 3 yrs 39 wks 0 days old
  • Updated: 5 Dec 2008
  • 70 entries
  • 139 comments
Tipical Charlie
Welcome to Tipical Charlie, a repository of all kinds of tips related to computing, from web developer and technologist, Charlie Arehart.
I'll mostly share my own tips that I've found others enjoyed hearing about. I'll welcome tips from others, too.
(Wondering where I came up with the name?)

Using the tab key at Windows command line to auto-fill file/directory names

posted Tuesday, 7 February 2006

If you ever find yourself on the Windows/DOS command line, typing commands that name files or directories, here's a real gem: while typing the command and then the file/dirname, use the TAB key to auto-fill the first file or directory name that matches what you've typed. And you can hit the tab key again to find the next file/dirname that matches.


So if you type: : cd \windows\sys and then hit the tab key, you'll be presented first with  cd \windows\system then if you hit the tab key you'll be offered : cd \windows\system32. Nifty. And you can use it to build up the command so you could have started with just cd \win, and hit the tab key to get cd \windows, then you could add on the \sys to the end of that and hit tab again to proceed as above.


Further, consider that if you type: cd \doc and then hit the tab key, it will fill it in with cd "\Documents and Settings" (assuming you have no other directory starting with that name). Note that Windows has also detected that the dirname has spaces and therefore has put quotes around it.


I said in the first paragraph that the feature works for file or directory names, and that's true, but note that the feature is smart enough to detect that the CD command (as an example) accepts only directories as its argument, so it does not show a file name that would match what you typed.


Still, the feature's not limited to DOS commands at all. You can use it with any command or command-line program you might use. Indeed, typing foo \windows\win and tab will create foo \windows\win.ini.


This may seem a trivial tip, but if you work at the command line a lot and can keep it in mind, I think you'll find it becomes indespensable. Linux and Unix fans have known and loved a simlar capability for a long time. Watch them at the keyboard. Man, they fly! :-) Finally, I'm not sure what release of Windows introduced this. I know it works on XP and 2003. Try it, and enjoy.

links: digg this    del.icio.us    technorati    reddit




1. Jeff Davis left...
Thursday, 6 April 2006 12:15 pm :: http://www.fmo.navy.mil

I remember this one! Doesn't work on Win 2000, but I remember there was a registry key one could set to turn it on. Unfortunately Navy systems are locked down, but it works fine on my XP laptop! Anyway thanks for the tip...


2. Charlie Arehart left...
Thursday, 6 April 2006 12:51 pm

Glad to have helped, Jeff. (Is the Jeff Davis I've met before?) I just did some digging and found this one reference to a registry tweak that may be what you mean: http://www.microsoft.com/mspress/books/sampchap/6232a.asp#152. If you have Win2k and want to try it, let me know how it goes. If anyone knows a better way to enable it in Win2k, please do share.

I've also just found a tool that can enable it (free but not the registry tweak approach), at http://www.morearty.com/filec/.

Finally, along these lines, something else that may intrigue some is this discussion of a set of tools that emulate Unix command line features for Windows: http://www.nsftools.com/tips/WinTips.htm#unixutilities. It refers both to CygWin and UnxUtils.


3. chandra bollam left...
Wednesday, 22 November 2006 9:03 am

To enable file and directory name completion under Windows, open regedit, navigate to the key, and change the values for CompletionChar and PathCompletionChar to 9.

http://www.jpsdomain.org/windows/winshell.html


4. Charlie Arehart left...
Wednesday, 22 November 2006 11:53 pm

Chandra, you don't need to do that, at least on Windows XP. The feature is already enabled, and the other comment pointed out a tweak for Win2k. In fact, reviewing the info above I do see that the URL pointed to no longer works, but fortunately the Google cache page for another vbersion of that document does work: http://64.233.161.104/search?q=cache:BM62bezkC74J:theso urce.ofallevil.com/mspress/books/sampchap/6232a.asp+sample+chapter+from+win dows+xp+registry+guide&hl=en&gl=us&ct=clnk&cd=1&lr=lang_en. I see that it basically points ou tthe same info you have now. Just clarifying, lest anyone think there's new info in what you're sharing. Thanks for offering it, though.