- Modifying environment variables
- Instead of using the graphic interface, you can change permanently an environmental variable with setx, part of the 'Windows XP Service Pack 2 Support Tools'
- Adding/removing from Path
- To add/remove entries from path, it is less messy and safer use pathman, part of 'Windows 2003 Resource Kit'
- Windows Script Host
- Check documentation about the 'Windows Script Host'. Forget batch files and learn to write shell scripting in javascript.
Variable | Example (2k/XP) | Example (W7) |
%ALLUSERSPROFILE% | C:\Documents and Settings\All Users | C:\ProgramData |
%APPDATA% | C:\Documents and Settings\{username}\Application Data | C:\Users\{username}\AppData\Roaming |
%COMPUTERNAME% | {computername} | |
%COMMONPROGRAMFILES% | C:\Program Files\Common Files | |
%COMMONPROGRAMFILES(x86)% | C:\Program Files (x86)\Common Files | |
%COMSPEC% | C:\Windows\System32\cmd.exe | |
%HOMEDRIVE% | C: | |
%HOMEPATH% | \Documents and Settings\{username} | \Users\{username} |
%PATH% | C:\Windows\system32;C:\Windows;{other paths} | |
%PATHEXT% | .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.WSF;.WSH | .com;.exe;.bat;.cmd;.vbs;.vbe;.js;.jse;.wsf;.wsh;.msc |
%PROGRAMFILES% | C:\Program Files | |
%PROGRAMFILES(X86)% | C:\Program Files (x86) | |
%PROMPT% | $P$G | |
%SYSTEMDRIVE% | C: | |
%SystemRoot% | C:\Windows | |
%TEMP% , %TMP% | C:\Documents and Settings\{username}\Local Settings\Temp | C:\Users\{username}\AppData\Local\Temp |
%USERNAME% | {username} | |
%USERPROFILE% | C:\Documents and Settings\{username} | C:\Users\{username} |
%WINDIR% | C:\Windows | |
%PUBLIC% | C:\Users\Public |