# Auto-completion in a DOS console

> Re-enable auto-completion in your old DOS console on Windows 2000 by modifying specific registry keys for a smoother command-line experience.

Author: [Guillaume Laforge](https://glaforge.dev/) | Published: 2005-01-26 | Topics: geek, groovy | Canonical: https://glaforge.dev/posts/2005/01/26/auto-completion-in-a-dos-console/


When I'm on an old PC, what frustrates me a lot is when I can't auto-complete file names or paths when I'm in a DOS Console. If your computer (an old Win2K box like I have at work) is not configured for completion, it's easy to re-enable it by modifying two keys in the registry:

*   `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor\CompletionChar`
*   `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor\PathCompletionChar`

To both keys, assign an hexadecimal value representing the key used for completing statements. I'm quite used to the tab key for that purpose, so I set the hexadecimal value to 0x09.  

Of course, I couldn't resist to use [Groovy](http://groovy.codehaus.org/) and [Scriptom](http://glaforge.free.fr/weblog/groovy.codehaus.org/COM+Scripting) (Windows ActiveX/COM bridge for Groovy I developed recently) to automate the process, here is how:

```groovy
import org.codehaus.groovy.scriptom.ActiveXProxy

wshell = new ActiveXProxy("WScript.Shell")
wshell.RegWrite("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Command Processor\\CompletionChar", 9, "REG_DWORD")
wshell.RegWrite("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Command Processor\\PathCompletionChar", 9, "REG_DWORD")
```
