delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/11/30/19:36:30

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Wed, 1 Dec 2004 11:33:17 +1100 (EST)
From: Luke Kendall <luke DOT kendall AT cisra DOT canon DOT com DOT au>
Subject: Re: PATH and SystemRoot oddity
To: cygwin AT cygwin DOT com
In-Reply-To: <Pine.GSO.4.61.0411261546140.14489@slinky.cs.nyu.edu>
MIME-Version: 1.0
Message-Id: <20041201003317.6835784C99@pessard.research.canon.com.au>

On 26 Nov, Igor Pechtchanski wrote:
>  On Fri, 26 Nov 2004, Luke Kendall wrote:
>  
> > I see that by default PATH includes some entries like
> > %SystemRoot%/System32
>  >
> > I also note that $SystemRoot is undefined, yet $SYSTEMROOT contains the
> > expected C:\WINDOWS value.
>  >
> > This of course causes problems.  Would a backslash-style path work
> > correctly if it were properly interpolated into the PATH?  Is the %
> > notation special magic for Cygwin to handle DOS-isms?
>  >
> > The case variance may be of interest, in that case.
>  
>  The case variance is a red herring.

Could you explain some more?  I was thinking that if SystemRoot but 
SYSTEMROOT was, it might be relevant.

>  Also, Cygwin doesn't understand the
>  %...% notation.

Sure, of course.

>  OTOH, you're not supposed to be seeing these entries in
>  the actual value of your PATH, either in Windows or in Cygwin.  Such
>  entries are usually caused by the wrong type assigned to the PATH value in
>  the registry (REG_SZ instead of REG_EXPAND_SZ).  Some buggy installers
>  change the type of the PATH registry entry.

Ah!  So at some point in the machine's history, some buggy installer
altered this, and it has knock-on effects like this.

>  You need to change it back,
>  so that strings like %SystemRoot% will be automatically expanded by
>  Windows before Cygwin ever sees them.
>  HTH,
>  	Igor

I couldn't find an entry for PATH that seemed to be the normal
environment variable - only things buried inside other items like CLSID
that seemed to be used for other things.

In the Control Panel I found that the system environment variable for
PATH was defined to use %SystemRoot%, so I suspect that's where it's
coming from.  And you're right, it's set badly for Windows and Cygwin,
and interfering with all shells:

C:\>echo %PATH%
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem
C:>net use
'net' is not recognized as an internal or external command,
operable program or batch file.

Thanks, Igor

luke


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019