Alias and history on Windows XP

DOSNow I know this is old technology, but I am a command line guy and when I flick over from Unix/Linux to Windows, I like to do things in a good old dos prompt. My most common mistake to use ls to list files instead of dir, clear instead of cls etc etc.

I also like to see the history of a session just so you can go back to see what you have done.

I did ask a couple of Windows Sysadmins I know if you can do aliasing on Windows XP, and they didn't think it could be done, they said it can in  Powershell but not in basic XP.  After a quick look around I found you can, thanks to the command doskey.

With this, you can set up all your little shortcuts, you can also use it for long complex commands, At the bottom is a quick look at some of the things I have setup.  

I have variables setup on all my windows machines that all point to my dropbox, this way whichever machine I work on, home, netbook, work I have the same entries, plus when I need to make any edits or add something new I just need to edit one file.

Setting up all your environment, takes a bit of time, but you get all the time back in the long run.  I have one executable written in AutoIT which sets all my variables and directories up in one run so I never have to worry, just run this on each machine and its all there.

I have this called on my start-up.bat when I log into Windows, so the line to call it is 

start /min cmd.exe /K "%scripts%\batch\doskey.cmd"

However this will only work for that one window, so in addition I have added the following registry key.  Navigate to HKEY_CURRENT_USER\Software\Microsoft\Command Processor Add a new value , string value is fine (Mine is Expandable String value, as I use my %scripts% variable), call it Autorun, then add the full patch to your batch file, so mine is "%scripts%"\batch\doskey.cmd.

Now when ever I load a new cmd prompt I have all my shortcuts etc.

I am getting a new work PC soon, so no doubt I will have to change everything around to use Powershell etc, if I do I will post an update.

I am always interested in your thoughts so if you have any comments or feedback then please feel free to add any comments, or you can mail me  here



DOSKEY ls=dir

DOSKEY clear=cls

REM Just for Geekbook - 1.2

DOSKEY enable_wireless=devcon enable *DEV_001C*

DOSKEY disable_wireless=devcon disable *DEV_001C*

REM History Alias - 1.3

DOSKEY history=DOSKEY /h

REM whereis command - 1.4

DOSKEY whereis="%scripts%"\batch\whereis.cmd $*

Evernote - Search within Office/iWorks documents

Disabling the Front Panel on my Samsung TV