Command line aliases in Windows

Aliases are nicknames for command calls and thus supersede a lot of typing. In Linux there exist the command alias, in Windows there is doskey. An alias can be defined as follows:

doskey ls=dir

Typed aliases are volatile , that means, these are no longer available after a recall of the command line console. In order to make them persistent two steps are necessary. Firstly, create a bat-script containing all aliases and save it to an arbitrary location. Secondly, insert a corresponding string value in the Windows registry.

  1. Open Registry by searching „regedit“
  2. Open HKEY_CURRENT_USER → SOFTWARE → Microsoft → Command Processor
  3. Add new String Value called AutoRun with the path to the created bat-script.registry_value

Whenever a command line console is opened, the script is loaded and automatically executed in the current session.


Kommentar verfassen

Trage deine Daten unten ein oder klicke ein Icon um dich einzuloggen:

Du kommentierst mit deinem Abmelden /  Ändern )


Du kommentierst mit deinem Facebook-Konto. Abmelden /  Ändern )

Verbinde mit %s