setx.exe usage (WinNT & Win2000)

G

Giuseppe R.

Hi to all,
I have a batch file in hand, written time ago for Windows NT which use
setx.exe utility to permanent set some environment variables. Example:
setx PATH %MyNewPath%;%PATH% -m

Together with batch file I also have the related setx.exe, 24.0 Kb, dated
December 2nd, 1999 and identical to setx.exe downloadable at Win2000
resource kit section:

http://www.microsoft.com/windows2000/techinfo/reskit/tools/existing/setx-o.a
sp

I'm using it on Windows 2000 with a troublesome problem: if application run
more time the batch file passing the same new path (it often happens...)
setx add it at beginning without notice it already exists. That is, after
some time, path variable risk to be:
path=%MyNewPath%;%MyNewPath%;%MyNewPath%;
losing old path, pulled out by the new path repetition.

Is this real setx.exe working?
On WinNT too?
A bit restricting, I was expecting a more "astute" working than:
set PATH =%MyNewPath%;%PATH%
that is, in practice, what setx do. Tool's help (setx.exe -i) isn't clear
about this point.

Have I to run setx only first time or anyone better knows this utility and
can deny my analysis? (helping me to solve my problem)


Thanks, ciao
G.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top