Here's a technique I use to customize my command prompt window. It's handy when adding new directories to the PATH, INCLUDE, and LIB environment variables for compiling new libraries. You can set them manually of course through 'My Computer' -> System Properties -> Advanced -> Environment Variables, but that's too many mouse clicks for me, and it's harder to read and adjust the changes made.

First, create a new shortcut or edit the existing Command Prompt shortcut properties, then place the following text in the 'Target:' edit box:

%SystemRoot%\system32\cmd.exe /k d:\home\user\robenv.bat

In the above line, “d:\home\user\robenv.bat” is a batch file where you do all your initialization work. For example, I have the following in robenv.bat:

@echo off
call "c:\Program Files\Microsoft Visual Studio .NET\Common7\Tools\vsvars32.bat"
set path=%path%;d:\usr\utils
set lib=%lib%;d:\usr\utils
set include=%include%;d:\usr\utils

The batch file gets run everytime you start a new command-prompt window. When I need to compile with new libraries, I just append the new dir to the “set lib=...” line. It's easier to maintain, and I can do any initialization work in the batch file. It's one way to simulate the .profile user script mechanism in Unix. I can even have different command prompt settings by creating a different shortcut and robenv.bat file. Neat huh?