nagan
nagan

Reputation: 41

Where is the path information in DOS saved

I had recently entered set path = c:\TC\bin;%path%. Thereafter entering path got this path = c:\tc\bin;BLAH-BLAH; and it worked. I closed command and reopened it does not work and on checking I get path=BLAH-BLAH; only. The recent addition I made was not present. Any clues? Thanks.

Upvotes: 2

Views: 71

Answers (1)

Vicky
Vicky

Reputation: 13244

Environment variables are saved in a registry setting.

When you edit an environment variable in a command shell, the change only applies to that command shell (as you found).

If you want to set the path for the whole system you need to set it centrally - in Windows XP you can right click on "My Computer", choose "Properties", "Advanced" then click on "Environment Variables" at the bottom, and similar methods apply to other Windows sytems.

If you want to edit it programmatically you would need to do this through the registry APIs. There are answers about how to do this here: Programmatically modifiy environment variables?

Upvotes: 1

Related Questions