Re: Win32 Environment Variable Read-only?

2006-02-05 Thread Chris Wagner
At 04:18 AM 2/4/2006 -0700, [EMAIL PROTECTED] wrote:
The original problem was that, after startup, the PATH contains duplicate 
pathnames. After debugging the startup sequence 
(IO.SYS-MSDOS.SYS-COMMAND.COM-CONFIG.SYS-AUTOEXEC.BAT), the problem 
seemed to originate with IO.SYS, which is a hard module to modify. So I 

The path variable is set solely, and exclusively, in autoexec.bat.  There
should be a line in there that says PATH=C:\  That and that alone will
be the path value in any command prompt windows u open under 98 and indeed
for all of Windows unless it is later modified by the starting shortcut that
launches the command prompt.  Do Start-Run-command.exe.  Then type path at
the prompt.  The value returned should be identical to whatever was
specified in autoexec.bat.  io.sys, msdos.sys, and config.sys have nothing
to do with the path.  If ur command prompt shortcut has a different path
than that, then it's the shortcut's fault.  Keep in mind that in
autoexec.bat there can be multiple cumulative path= statements.


--
REMEMBER THE WORLD TRADE CENTER ---= WTC 911 =--
...ne cede malis

0100

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Win32 Environment Variable Read-only?

2006-02-05 Thread Hans Schleichert

Chris Wagner wrote:

The path variable is set solely, and exclusively, in autoexec.bat.  There
should be a line in there that says PATH=C:\  That and that alone will
be the path value in any command prompt windows u open under 98 and indeed
for all of Windows unless it is later modified by the starting shortcut that

...

than that, then it's the shortcut's fault.  Keep in mind that in
autoexec.bat there can be multiple cumulative path= statements.


Although this is getting off-topic, let me add that, at least in MS DOS 
6.22, you can also set the path in CONFIG.SYS, using a SET statement, 
and that PATH statements in AUTOEXEC.BAT aren't cumulative under MS DOS, 
they simply replace the old path with the new one. Don't know about Win 9x.


Hans
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Win32 Environment Variable Read-only?

2006-02-05 Thread Chris Wagner
At 12:50 PM 2/5/2006 +0100, perl-win32-users@listserv.ActiveState.com wrote:
and that PATH statements in AUTOEXEC.BAT aren't cumulative under MS DOS, 
they simply replace the old path with the new one. Don't know about Win 9x.

The are cumulative if u include the variable itself in the new path= line


C:\Documents and Settings\administratorpath=c:\windows;\c:\dos
C:\Documents and Settings\administratorpath
PATH=c:\windows;\c:\dos
C:\Documents and Settings\administratorpath=%path%;c:\windows
C:\Documents and Settings\administratorpath
PATH=c:\windows;\c:\dos;c:\windows




--
REMEMBER THE WORLD TRADE CENTER ---= WTC 911 =--
...ne cede malis

0100

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Win32 Environment Variable Read-only?

2006-02-04 Thread L. Neil Johnson
 Using AS Perl 5.8.7 under W98SE, the PATH environment variable is
 displayed, then assigned a new value; but the new value doesn't propagate 

 back to the MS-DOS %PATH% variable. Are the %ENV values read-only?

Many thanks to Robert, Bill, Alex, and Chris who responded to this inquiry. 
I should have figured out that child processes can't change their parent 
environment (but didn't)... and thus the value of this community.

The original problem was that, after startup, the PATH contains duplicate 
pathnames. After debugging the startup sequence 
(IO.SYS-MSDOS.SYS-COMMAND.COM-CONFIG.SYS-AUTOEXEC.BAT), the problem 
seemed to originate with IO.SYS, which is a hard module to modify. So I 
wrote a PERL program that culled duplicates from the PATH environment 
variable and assigned the new path string to $ENV{PATH}. I tried to 
interpret it from AUTOEXEC.BAT, but got a Not a DOS program (probably in 
real mode) error message at boot time. I then tried to execute it from the 
shortcuts for the command prompts, but for the reason stated, that didn't 
work.

The less-than-desirable fix that I'm now using is to reference batch-file 
SHELLINI.BAT in the shortcuts to the command-prompts.  The batch-file 
invokes the PERL interpreter as in:

  ...
  Perl C:\Programs\Scripts\PATHcull.plx
  CALL C:\PROGRAMS\Scripts\PATH.BAT
  ...

PATHcull.plx splits the PATH string into pathnames, culls out the 
duplicates, and concatenates a new string ($sRed), which is written in a 
SET PATH=$sRed command to file PATH.BAT (yes, the Admin's hack -- the 
temporary batch-file -- rears its hoary head).  And SHELLINI.BAT calls 
PATH.BAT to execute the SET PATH command.  At least that fixes PATH for 
each instance of the command-prompt.

Regards, Neil
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Win32 Environment Variable Read-only?

2006-02-03 Thread L. Neil Johnson
Using AS Perl 5.8.7 under W98SE, the PATH environment variable is 
displayed, then assigned a new value; but the new value doesn't propagate 
back to the MS-DOS %PATH% variable. Are the %ENV values read-only?

  C:\Programs\PERLSET
  ...
  PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\PERL\BIN\;C:\THINKPAD
  ...

  C:\Programs\PERLperl
  print $ENV{PATH}\n;
  $ENV{PATH} = 'C:\WINDOWS;C:\WINDOWS\COMMAND';
  print $ENV{PATH}\n;
  ^D
  C:\WINDOWS;C:\WINDOWS\COMMAND;C:\PERL\BIN\;C:\THINKPAD
  C:\WINDOWS;C:\WINDOWS\COMMAND

  C:\Programs\PERLSET
  ...
  PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\PERL\BIN\;C:\THINKPAD
  ...

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Win32 Environment Variable Read-only?

2006-02-03 Thread Alexander Apprich
L. Neil Johnson wrote:
 Using AS Perl 5.8.7 under W98SE, the PATH environment variable is 
 displayed, then assigned a new value; but the new value doesn't propagate 
 back to the MS-DOS %PATH% variable. Are the %ENV values read-only?
 
   C:\Programs\PERLSET
   ...
   PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\PERL\BIN\;C:\THINKPAD
   ...
 
   C:\Programs\PERLperl
   print $ENV{PATH}\n;
   $ENV{PATH} = 'C:\WINDOWS;C:\WINDOWS\COMMAND';
   print $ENV{PATH}\n;
   ^D
   C:\WINDOWS;C:\WINDOWS\COMMAND;C:\PERL\BIN\;C:\THINKPAD
   C:\WINDOWS;C:\WINDOWS\COMMAND
 
   C:\Programs\PERLSET
   ...
   PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\PERL\BIN\;C:\THINKPAD
   ...

that's because you get a copy of the environment for your perl
process. after you process is finished everything is like before.

Hth

Alex
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Win32 Environment Variable Read-only?

2006-02-03 Thread $Bill Luebkert
L. Neil Johnson wrote:

 Using AS Perl 5.8.7 under W98SE, the PATH environment variable is 
 displayed, then assigned a new value; but the new value doesn't propagate 
 back to the MS-DOS %PATH% variable. Are the %ENV values read-only?

Basically you can only change the env vrbls for the current task and
any children it spawns - not the parent (you have to do that at boot up).

   C:\Programs\PERLSET
   ...
   PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\PERL\BIN\;C:\THINKPAD
   ...
 
   C:\Programs\PERLperl
   print $ENV{PATH}\n;
   $ENV{PATH} = 'C:\WINDOWS;C:\WINDOWS\COMMAND';
   print $ENV{PATH}\n;
   ^D
   C:\WINDOWS;C:\WINDOWS\COMMAND;C:\PERL\BIN\;C:\THINKPAD
   C:\WINDOWS;C:\WINDOWS\COMMAND
 
   C:\Programs\PERLSET
   ...
   PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\PERL\BIN\;C:\THINKPAD
   ...

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Win32 Environment Variable Read-only?

2006-02-03 Thread Chris Wagner
At 04:54 AM 2/3/2006 -0700, [EMAIL PROTECTED] wrote:
Using AS Perl 5.8.7 under W98SE, the PATH environment variable is 
displayed, then assigned a new value; but the new value doesn't propagate 
back to the MS-DOS %PATH% variable. Are the %ENV values read-only?

A child process can't change the environment of its parent process.




--
REMEMBER THE WORLD TRADE CENTER ---= WTC 911 =--
...ne cede malis

0100

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs