[comp.windows.ms] Changing the path

dmurdoch@watstat.waterloo.edu (Duncan Murdoch) (05/04/91)

I'm new at Windows, so this is probably an easy question.  (Is there a FAQ
list somewhere?)   How do I change the master copy of the Path from within
Windows?  What I want is the equivalent of the PATH command in COMMAND.COM;
just opening a DOS window and using it doesn't work, because the change is
local to that window.

Please send replies by email; if anyone is interested, I'll summarize back
to this group.

Duncan Murdoch
dmurdoch@watstat.waterloo.edu

hadgraft@vaxc.cc.monash.edu.au (Hadgraft) (05/09/91)

In article <1991May3.194552.24233@maytag.waterloo.edu>, dmurdoch@watstat.waterloo.edu (Duncan Murdoch) writes:
>
> I'm new at Windows, so this is probably an easy question.  (Is there a FAQ
> list somewhere?)   How do I change the master copy of the Path from within
> Windows?  What I want is the equivalent of the PATH command in COMMAND.COM;
> just opening a DOS window and using it doesn't work, because the change is
> local to that window.
>
As far as I know, it's not possible. It pays to get it right first time.

Since each application gets it's own copy of the DOS environment, it's possible
to change the PATH for each one, which might solve your problem. I do this when
building Windows applications. I run a batch file that sets the appropriate
PATH, then runs MAKE. This saves having all the development directories
cluttering my normal PATH.
--
  +--------------------------------------+
  |  Roger Hadgraft                 +----------------------------------+
  |  Senior Lecturer                |  hadgraft@civeng.monash.edu.au   |
  |  Dept of Civil Engineering      |  phone:  +61 3 565 4983          |
  |  Monash University              |  fax:    +61 3 565 4944 or 3409  |
  |  Clayton, Vic. 3168. Australia. +----------------------------------+
  +--------------------------------------+

hd7x@vax5.cit.cornell.edu (Sanjay Aiyagari) (05/10/91)

In article <1991May9.091904.86688@vaxc.cc.monash.edu.au>,
hadgraft@vaxc.cc.monash.edu.au (Hadgraft) writes: 
> In article <1991May3.194552.24233@maytag.waterloo.edu>, 
> dmurdoch@watstat.waterloo.edu (Duncan Murdoch) writes:
>>
>> I'm new at Windows, so this is probably an easy question.  (Is there a FAQ
>> list somewhere?)   How do I change the master copy of the Path from within
>> Windows?  What I want is the equivalent of the PATH command in COMMAND.COM;
>> just opening a DOS window and using it doesn't work, because the change is
>> local to that window.
>>
> As far as I know, it's not possible. It pays to get it right first time.
> 
> Since each application gets it's own copy of the DOS environment, it's 
> possible to change the PATH for each one, which might solve your problem. I 
> do this when building Windows applications. I run a batch file that sets the 
> appropriate PATH, then runs MAKE. This saves having all the development 
> directories cluttering my normal PATH.

True, this is the only way to do it, but Windows SHOULD be able to let you
change the default environment passed to DOS processes.  The DOS EXEC call
allows a pointer to an enviroment block; if this is 0 then it just uses the
parent environment (in this case, the PATH statement set before Windows was
run).  It looks like Microsoft just let this parameter be 0 when issuing DOS
EXEC calls; if Windows had a program called, say, "Environment", that let you
edit and save a default environment configuration, this could easily be passed
to all executing programs (DOS as well as Windows programs), allowing you to
change the default PATH without exiting to DOS.  It would also eliminate the
need to have a huge PATH statement before loading Windows, as is now necessary.

Sanjay Aiyagari (hd7x@vax5.cit.cornell.edu)