Cammand Line auto-complete

Discussion in 'Software' started by Phil, Dec 4, 2004.

  1. Phil
    Honorary Member

    Phil Gigabyte Poster

    1,680
    7
    87
    I've just come across this great tip. Paste the following lines into a cammand console to turn on auto-complete using the tab key at the command prompt. For instance if you're at c:\ and want to cd into the Program files directory then type cd pro then press tab and it will complete the Program Files bit for you.

    reg add "hklm\software\microsoft\command processor" /v CompletionChar /t REG_DWORD /d 0x9 /f
    reg add "hklm\software\microsoft\command processor" /v PathCompletionChar /t REG_DWORD /d 0x9 /f

    I've tested this on XP and it works a treat, apparently you need to use * instead of Tab on Windows 2000

    Phil
     
    Certifications: MCSE:M & S MCSA:M CCNA CNA
    WIP: 2003 Upgrade, CCNA Upgrade
  2. AJ

    AJ 01000001 01100100 01101101 01101001 01101110 Administrator

    6,897
    182
    221
    great one there Phil.

    Just tryed it and it works a treat. Have been wondering for ages why you can do it in Linux but not in Windows.

    Cheers Phil [​IMG]
     
    Certifications: MCSE, MCSA (messaging), ITIL Foundation v3
    WIP: Breathing in and out, but not out and in, that's just wrong
  3. tripwire45
    Honorary Member

    tripwire45 Zettabyte Poster

    13,493
    180
    287
    Nice. You can use autocomplete on the command line with both Linux and on Cisco switches and routers. Good for those pesky commands that you *almost* remember. :biggrin
     
    Certifications: A+ and Network+
  4. Fergal1982

    Fergal1982 Petabyte Poster

    4,196
    172
    211
    erm..... guys??????

    im using xp home, and haven't put either of those commands in (unless they are already there) - and ive been able to do it since.... wel.... forever!

    Fergal
     
    Certifications: ITIL Foundation; MCTS: Visual Studio Team Foundation Server 2010, Administration
    WIP: None at present
  5. AJ

    AJ 01000001 01100100 01101101 01101001 01101110 Administrator

    6,897
    182
    221
    I've got XP Pro with SP 1 on and it doesn't work unless I add the reg setting. Weird or what. :blink
     
    Certifications: MCSE, MCSA (messaging), ITIL Foundation v3
    WIP: Breathing in and out, but not out and in, that's just wrong
  6. Fergal1982

    Fergal1982 Petabyte Poster

    4,196
    172
    211
    strange indeed.
     
    Certifications: ITIL Foundation; MCTS: Visual Studio Team Foundation Server 2010, Administration
    WIP: None at present
  7. Bluerinse
    Honorary Member

    Bluerinse Exabyte Poster

    8,878
    181
    256
    Well I have never used autocomplete with any command line interpreter before but I thought I would test this out to see.

    I am using W2K Pro and did not enter the registry lines above, yet it does work :eek: How strange? I am not sure as to how useful it is though because it does seem a bit hit and miss, as to what the autocomplete pulls up. For example CD M* takes you to My Music when I wanted to switch to My Documents. Is there an explanation somewhere that gives more instruction on how to use these short cuts?

    Pete
     
    Certifications: C&G Electronics - MCSA (W2K) MCSE (W2K)
  8. Fergal1982

    Fergal1982 Petabyte Poster

    4,196
    172
    211
    if you put in so little detail, the system will autoselect the first option alphabetically. keep pressing tab to cycle through the option, or input more detail!
     
    Certifications: ITIL Foundation; MCTS: Visual Studio Team Foundation Server 2010, Administration
    WIP: None at present
  9. Bluerinse
    Honorary Member

    Bluerinse Exabyte Poster

    8,878
    181
    256
    Drat, I just lost my long post :cry:

    Oh well, now where was I?

    I was saying thanks Fergal for the help but with W2K you can't use the tab in that fashion, you have to append an * to the end of the line. It works well, that is to say in a more predicatble fashion if the directory name doesn't contain spaces. Possibly XP deals with this issue in a better way?

    There doesn't seem to be a way of tabbing through the possible selections because entering another * just brings up the olde command not recognised message.

    Cheers,

    Pete
     
    Certifications: C&G Electronics - MCSA (W2K) MCSE (W2K)
  10. Taz69

    Taz69 Byte Poster

    125
    0
    26
    Nice one Phil :D

    Whilst trying to get a little more info on these registry settings I came accross this page.
    (Possibly where this tip originally came from?)

    http://www.mcpmag.com/columns/print.asp?EditorialsID=802

    It might be worth a read as it gives 1 or 2 other tips that might also come in usefull.
     
    Certifications: MCSE: S, MCSA:M, MCSA: S, Net+ & 70-284
    WIP: MCSA 2003 & MCSA:Messaging 2003
  11. Bluerinse
    Honorary Member

    Bluerinse Exabyte Poster

    8,878
    181
    256
    Cheers Taz, that's a great link. I didn't know you could fiddle with the properties of the DOS window and make it larger etc. I found that to be somewhat cool 8)

    Pete
     
    Certifications: C&G Electronics - MCSA (W2K) MCSE (W2K)

Share This Page

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.