6

Possible Duplicates:
Set Permanent Environmental Variable in Windows XP
Is there a way to set Windows environment variables from the command line PERMANENTLY

The set command does not save values between cmd.exe sessions. How can I save environmental values between new cmd.exe sessions?

For example the set command will work for my current session only:

set path=%path%;C:\Mingw\bin

Upon restarting cmd.exe my path string has been reset.

Possible solution: .bashrc or .bash_profile equivalent for DOS

4 Answers4

11

Use SETX as per answers in this thread (linked from the right hand side here as a related question): Is there a way to set Windows environment variables from the command line PERMANENTLY

AdamV
  • 6,396
3

Add/change them from Global environment variables. To access this (Assuming Windows XP as your OS ), right click on My Computer -> Properties -> Advanced Tab -> Environment Variables and add whatever is required.

1

You have several options:

Assuming Windows XP Pro:

  1. Go into c:\windows\system32\autoexec.nt and change to add the path there.
  2. Right click My Computer, go into properties, Advanced, Environmental Variables, change there.
  3. Create a login script. Right click My Computer, go into Manage. Go into Local Users and Groups, then Users. Right click the login, choose properties, go into Profile and set th Logon script. The default location it looks for login scripts are c:\windows\system32\repl\import\scripts.
Blackbeagle
  • 6,702
0

To get Windows to save environment variables, Right-click on My Computer, click Properties, then Advanced | Environment Variables and edit it there.