set path

G

gary

im not sure if i understand tbe whole set path= command
correctly... need some help. if i have a batch file that
starts like this:

@echo off
set path=%windir%;%windir%\system32;c:\exe

this will only set the path just for this batch file. is
this correct? if so how can i change the path in the
environment variables through a batch file to be set to
this at all times?
 
D

Dave Patrick

setx.exe from the resource kit.

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| im not sure if i understand tbe whole set path= command
| correctly... need some help. if i have a batch file that
| starts like this:
|
| @echo off
| set path=%windir%;%windir%\system32;c:\exe
|
| this will only set the path just for this batch file. is
| this correct? if so how can i change the path in the
| environment variables through a batch file to be set to
| this at all times?
|
 
M

Matthias Tacke

gary said:
im not sure if i understand tbe whole set path= command
correctly... need some help. if i have a batch file that
starts like this:

@echo off
set path=%windir%;%windir%\system32;c:\exe

this will only set the path just for this batch file. is
this correct?
Yes it is, but you should *not* do it this way.
If you want to append a path use:
set path=%path%;c:\exe
if so how can i change the path in the
environment variables through a batch file to be set to
this at all times?

There are tools to help you in the w2k reskit:
setx.exe
pathman.exe
or thirdparty: xset

But you have to keep in mind that changes are local or take effect after
restarting.
Tweaking the path may corrupt the settings, Bill Stewart wrote a tool
fixpath to help in these cases.
http://mywebpages.comcast.net/stewartb/misctools.html

You could tamper with the registry or use a vbscript.

And all this was already posted and may be found with google.
http://groups.google.com/groups?as_...roup=microsoft.public.win2000.cmdprompt.admin
 
P

Paul R. Sadowski

gary said:
@echo off
set path=%windir%;%windir%\system32;c:\exe

this will only set the path just for this batch file. is

Not to be picky but it will change it for the life of this instance of the
command interpreter. If you keep a couple of command prompt windows open all
the time then that can make a difference. If you just click on batch files
from explorer then you are correct.

setx as others have said will do what you want.
 

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