Skip to content

Instantly share code, notes, and snippets.

@michfield
Last active December 10, 2015 22:48
Show Gist options
  • Save michfield/4504305 to your computer and use it in GitHub Desktop.
Save michfield/4504305 to your computer and use it in GitHub Desktop.
Windows command line completion #windows

Add command line completion to Windows in two copy-paste steps

(
echo/@echo off
echo/:: History alias is assuming you are using clink with default clink profile location
echo/doskey history=cat "%LOCALAPPDATA%\clink\.history" $*
echo/doskey l=ls -CF --color=auto $*
echo/doskey la=ls -A --color=auto $*
echo/doskey ll=ls -alF --color=auto $*
echo/doskey ls=ls --color=auto $*
echo/echo Registered common DOS aliases.
) >"%HOME%\.bashrc.bat"

And make it auto-executed:

reg add "HKCU\Software\Microsoft\Command Processor" /f /v "AutoRun" /t REG_SZ /d "\"%HOME%\.bashrc.bat\""

NOTE: AutoRun can appear in HKLM and HKCU. If both appear in the registry, the system first runs the value of the entry in HKLM, and then it runs the value in HKCU.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment