Skip to content

Instantly share code, notes, and snippets.

@postcog
postcog / doskey.mac
Created April 18, 2015 20:42
my doskey macro file (aka alias) for windows (7) command line shell environment
;============================== loading on startup ===============================
;= create a cmd link with the following target :
;= %comspec% /k "(doskey /macrofile=%userprofile%\doskey.mac)"
;============================= File listing enhancements ============================
alias_old=IF ".$*." == ".." (doskey /macros) ELSE (IF /I "$1" == "SAVE" (doskey /macros $g "%USERPROFILE%\doskey.mac" & ECHO Aliases SAVED) ELSE (IF /I "$1"=="LOAD" (doskey /macrofile="%USERPROFILE%\doskey.mac" & ECHO Aliases LOADED & doskey /macros) ELSE (doskey $*)))
alias=IF ".$*." == ".." (doskey /macros) ELSE (IF /I "$1" == "SAVE" (doskey /macros $g "%USERPROFILE%\doskey.mac" & ECHO Aliases SAVED) ELSE (IF /I "$1"=="LOAD" (doskey /macrofile="%USERPROFILE%\doskey.mac" & ECHO Aliases LOADED & doskey /macros) ELSE (IF /I "$1"=="EDIT" (notepad %userprofile%\doskey.mac) ELSE (IF /I "$1"=="EDIT2" (notepad2 %userprofile%\doskey.mac) ELSE (doskey $*)))))
alias_=IF ".$*." == ".." (doskey /macros) ELSE (IF /I "$1" == "SAVE" (doskey /mac