Click to See Complete Forum and Search --> : DOS batch commands and NT


Ray-zer
July 31st, 2000, 05:01 PM
Does anybody know how to set a variable (via a DOS batch file) on NT but keep the variable set even after the DOS command window is closed? This worked fine for Windows 95 and 98 but with NT (and Windows 2000) each session is its own session so variables (including 'path' statements) are lost. Putting in the autoexec or going through the control panel to set an environment variable is not an option. It has to be done within the DOS batch file. Is this possible?

Equalizer
July 31st, 2000, 05:41 PM
To set permanent "system" or "user" variables, try SETX.EXE (from the NT Resource Kit) or SETENV (http://barnyard.syr.edu/~vefatica/#SETENV) from Vincent Fatica's website.

Could also use a .reg file to modify the HKCU\Environment key.

[This message has been edited by Equalizer (edited 07-31-2000).]

Ray-zer
August 2nd, 2000, 01:59 PM
It looks like these utilities will work for me. Thanks Equalizer.

Originally posted by Ray-zer:
Does anybody know how to set a variable (via a DOS batch file) on NT but keep the variable set even after the DOS command window is closed? This worked fine for Windows 95 and 98 but with NT (and Windows 2000) each session is its own session so variables (including 'path' statements) are lost. Putting in the autoexec or going through the control panel to set an environment variable is not an option. It has to be done within the DOS batch file. Is this possible?