Configuring environment variables in Windows NT
Environment variables are used almost everywhere in Windows, and there are several types of environment variables: (Listed in initialization order)
- System generated like %DATE%, %TIME%, %SYSTEMROOT%, %COMPUTERNAME%, created when Windows starts
- Local Machine specified (Same for all users ex. PATH)
- AUTOEXEX.BAT specified
- System generated like %USERNAME%, %USERDOMAIN% and %USERPROFILE% are created when user logs in
- User specified (Unique for this user)
- Command Prompt specified (Lives and dies with the command prompt)
Local Machine and User specified variables can be configured here:
- WinNT4 : Control Panel -> System -> Environment-tab
- Win2k/Xp : Control Panel -> System -> Advanced-tab -> Environment Variables-button
They can also be accessed through the registry (STRINGs) :
[HKEY_LOCAL_MACHINE \SYSTEM \CurrentControlSet \Control \Session Manager \Environment]
[HKEY_CURRENT_USER \Environment]
Note the environment variables will be available both in the Cmd.exe and the MS-DOS Environment Command.com.