Please add /cygdrive/c/Windows/Sysnative to the default PATH

Brian Inglis Brian.Inglis@SystematicSw.ab.ca
Thu Nov 19 15:57:26 GMT 2020


On 2020-11-17 16:41, tealhill via Cygwin wrote:
> On 2020-11-17 4:23 PM, Thomas Wolff wrote:
>> Am 17.11.2020 um 20:54 schrieb tealhill via Cygwin:
>  >>
>>> Cygwin's /etc/profile sets the PATH.
>>>
>>> Could /etc/profile please also add /cygdrive/c/Windows/Sysnative to the end 
>>> of the PATH?
>  >
>> It doesn't add any other Windows folders so why this one.
> 
> ### Summary
> 
> Why should Cygwin add Sysnative to $PATH?  As a workaround for Microsoft's 
> failure to add Sysnative to %PATH%.

You have the option to add SysNative to your system or user PATH under Windows, 
although that would best be done in your login script.

> ### Full explanation
> 
> Cygwin imports the Windows %PATH% variable at startup.
> 
> It would be ideal if Microsoft would add Sysnative to the default Windows 
> %PATH%.  Such a change would help Cygwin users and others.  But I doubt that 
> Microsoft will make this change.
> 
> Therefore, I am suggesting that Cygwin work around Microsoft's omission.  My 
> suggested workaround is for Cygwin to add Sysnative to its own $PATH, 
> automatically.

Cygwin starts with Cygwin paths /usr/bin:/bin and everything else is up to you.
You may add to your Cygwin PATH in your shell profile with code that switches 
depending on the existence of SysWOW64 and SysNative: cygpath -F 37 gives your 
application sysdir path, and cygpath -F 41 gives your x86 sysdir if there is one:

	https://docs.microsoft.com/en-ca/dotnet/api/system.environment.specialfolder?view=net-5.0

	https://docs.microsoft.com/en-ca/windows/win32/api/shlobj_core/nf-shlobj_core-shgetknownfolderidlist

	https://docs.microsoft.com/en-ca/windows/win32/shell/knownfolderid

and please note that SysNative appears nowhere!

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in binary units and prefixes, physical quantities in SI.]


More information about the Cygwin mailing list