Windows コマンドプロンプトに Linux 風エイリアスを設定

1.macros.txt を作成しCドライブのユーザー直下に置く

 

macros.txtの中身は以下のような感じ(ご自由に)。

 

cat=type $*

cp=copy $*

h=doskey /history

ll=dir /ad

ls=dir /w

mv=move $*

pwd=echo %CD%

rm=del $*

~=cd C:\Users\mhaya

 

2.レジストリに登録

 

 

  • Windowsキー+R で「regedit」を実行
  • HKEY_CURRENT_USER\Software\Microsoft\Command Processor\ に移動
  • 文字列値 AutoRun を作成
  • 値に doskey /macrofile=%USERPROFILE%\macros.txt を設定

 

 

参考

http://neos21.hatenablog.com/entry/2016/01/19/031150