On Windows, the terminal didn't have a init file like rc file on Linux. If you have a lot of custom environment variable and favorite settings, its very common that you have to reconfigure them sometimes .

Messed up with system environment is not a good idea, they may lost or be overwrite by reinstall OS or software. It would nice if we can put all these setting in one place and load it when terminal start up , just like bashrc file in Linux.

There is a simple method to do it. Drag a shortcut of cmd.exe to your desktop or start menu and click the properties. Paste these code to the "target" input box:

 
C:\Windows\System32\cmd.exe /k d:\bin\env.bat
 

Below is an example of the content of evn.bat.

 
 
@echo off
color 0a
set CLASSPATH=%CLASSPATH%D:\Java\jdk1.5.0\lib\mysql-connector-java-5.0.8-bin.jar;D:\Program Files\Java\jre7\lib\ext\jai_codec.jar;D:\Program Files\Java\jre7\lib\ext\jai_core.jar;d:\bin\javalib\*;
 
 
set PATH=%PATH%;D:\Microsoft Visual Studio 8\Common7\IDE;D:\Microsoft Visual Studio 8\VC\BIN;D:\Microsoft Visual Studio 8\Common7\Tools;D:\Microsoft Visual Studio 8\Common7\Tools\bin;D:\Microsoft Visual Studio 8\VC\PlatformSDK\bin;D:\Microsoft Visual Studio 8\SDK\v2.0\bin;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;G:\Microsoft Visual Studio 8\VC\VCPackages;D:\Program Files\Subversion;D:\Program Files\nmap-5.00;%bindir%\help;D:\php\MySQL-5.0.83\bin;D:\Program Files\MyEclipse 5.5.1 GA\eclipse\plugins\org.apache.ant_1.6.5\bin;E:\Program Files\MyEclipse 5.5.1 GA\eclipse\plugins\org.apache.ant_1.6.5\bin;D:\Program Files\Java\jdk1.7.0\bin;D:\Python27;
 
set INCLUDE=D:\Microsoft Visual Studio 8\VC\ATLMFC\INCLUDE;D:\Microsoft Visual Studio 8\VC\INCLUDE;D:\Microsoft Visual Studio 8\VC\PlatformSDK\include;
set LIB=D:\Microsoft Visual Studio 8\VC\ATLMFC\LIB;D:\Microsoft Visual Studio 8\VC\LIB;D:\Microsoft Visual Studio 8\VC\PlatformSDK\lib;
 
SET LIBPATH=C:\Windows\Microsoft.NET\Framework\v2.0.50727;D:\Microsoft Visual Studio 8\VC\ATLMFC\LIB
 
set pathext=%pathext%;.php
set pathext=%pathext%;.py
assoc .php=phpfile
 
ftype phpfile=d:\php\php-5.2.10-Win32\php.exe  "%%1" %%*
 
ftype Python.File="D:\Python27\python.exe" "%%1" %%*
 
set M2_HOME=D:\apache-maven-3.0.5
set PATH=%PATH%;%M2_HOME%\bin
 
set PATH=%PATH%;D:\php\php-5.2.10-Win32
set PATH=%PATH%;D:\gradle-1.5\bin
set GRADLE_USER_HOME=D:\gradle-1.5\.gradle
 
 

This file include custom cache directory of Maven and Gradle, associate with php and python interpreter for php and py script files and some bin directory.

Now you can leave the system environment setting alone and don't have to worry about maintain your settings, all the settings are kept in the env.bat.