Command Line Love 101
No, this isn’t about PowerShell. This is about the old Windows command line. You know, the one your dad uses. And me, too.
Here’s how I set mine up.
My Own bin
I create a c:\tools\bin folder. This is where I keep all the custom stuff I want in my path. Stuff that I put in here is just my own little smattering of command line tools, command files, etc.
MyCommandPrompt.cmd
Inside that bin folder I create a command file, MyCommandPrompt.cmd. This is actually the entry point to my command line. From inside this file, I will invoke my own cmd.exe call, but I will invoke a bunch of other stuff to set it up before I do.
@call "%VS110COMNTOOLS%\VsDevCmd.bat"
prompt $g
title Just what do you think you are doing, Dave?
color 8e
PATH=%PATH%;c:\tools\bin;
cd c:\projects\
cls
The first line in this file calls another file that comes with VS2012. The variable resolves as:
Go check out the file that calls, it is your developer command line and contains some things that will help you see how VS and the .NET frameworks sit on your machine. I will leave it to you to dissect the rest of those lines, but suffice to say they give me a command line that has some fun in it.
My Shortcut
I then create a shortcut in my bin folder that calls MyCommandPrompot.cmd. I do this because I want to customize some of the attributes of the shortcut calling the command file. For example, I want an elevated permission prompt, I want to run this all as admin.
Inside the shortcut, the Target value is:
%comspec% /k C:\tools\bin\MyCommandPrompt.cmd
And I can still set up all the other command line options I like for my command line. Buffer size, font, window size and position, etc.
Finally, I launch the shortcut and pin it to my taskbar. Now when I launch my command line I get the following.
What do you do with your command line environment?


