Problem with path environment variable


perdrix

Active member
Member
Local time
8:11 PM
Posts
84
OS
Windows 11 for Workstations
I have installed flex, bison and gperf to C:\Program Files(x86)\GnuWin32\bin and that directory has been added to path:

Code:
D:\Github\qt-build>path
PATH=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433\bin\HostX86\x86;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\VC\VCPackages;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\bin\Roslyn;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\vs2019\;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\;C:\Program Files (x86)\HTML Help Workshop;C:\Program Files\Microsoft Visual Studio\2022\Community\Team Tools\DiagnosticsHub\Collector;C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\\x86;C:\Program Files (x86)\Windows Kits\10\bin\\x86;C:\Program Files\Microsoft Visual Studio\2022\Community\\MSBuild\Current\Bin\amd64;C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\;C:\Python312\Scripts\;C:\Python312\;C:\Program Files (x86)\VMware\VMware Workstation\bin\;C:\Program Files\ImageMagick-7.1.1-Q16-HDRI;C:\Program Files\Python311\Scripts\;C:\Program Files\Python311\;C:\Program Files\Microsoft\jdk-17.0.6.10-hotspot\bin;C:\Program Files (x86)\Cuminas\Document Express DjVu Plug-in\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\gs\gs10.00.0\bin;C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin\;C:\Program Files\IVI Foundation\VISA\Win64\Bin\;C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin;C:\PROGRAM FILES (X86)\COMMON FILES\ORACLE\JAVA\JAVAPATH;C:\PROGRAMDATA\ORACLE\JAVA\JAVAPATH;C:\PROGRAM FILES\DELL\DW WLAN CARD;C:\WINDOWS\SYSTEM32;C:\WINDOWS;C:\WINDOWS\SYSTEM32\WBEM;C:\WINDOWS\SYSTEM32\WINDOWSPOWERSHELL\V1.0\;C:\Windows\System32\OpenSSH\;C:\PROGRAM FILES (X86)\NVIDIA CORPORATION\PHYSX\COMMON;C:\PROGRAM FILES (X86)\NTP\BIN;C:\PROGRAM FILES\MICROSOFT DNX\DNVM\;C:\PROGRAM FILES (X86)\WINDOWS KITS\8.1\WINDOWS PERFORMANCE TOOLKIT\;C:\PROGRAM FILES (X86)\WINMERGE;C:\PROGRAM FILES (X86)\WINDOWS KITS\10\WINDOWS PERFORMANCE TOOLKIT\;C:\PROGRAM FILES (X86)\VISUAL LEAK DETECTOR\BIN\WIN32;C:\PROGRAM FILES (X86)\VISUAL LEAK DETECTOR\BIN\WIN64;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Kensington\TrackballWorks;C:\Program Files (x86)\Microchip\MPLAB C32 Suite\bin;C:\Program Files\TortoiseGit\bin;C;C:\Program Files (x86)\Visual Leak Detector\bin\Win32;C:\Program Files (x86)\Visual Leak Detector\bin\Win64;C:\Program Files\Calibre2\;C:\Program Files\CMake\bin;C:\Program Files\Git\cmd;C:\ProgramData\chocolatey\bin;C:\Program Files\nodejs\;C:\Program Files(x86)\GnuWin32;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;[COLOR=rgb(184, 49, 47)]C:\Program Files(x86)\GnuWin32\bin;[/COLOR]C:\Users\amonra\AppData\Local\Microsoft\WindowsApps;C:\Users\amonra\AppData\Local\GitHubDesktop\bin;C:\Users\amonra\AppData\Local\gitkraken\bin;C:\Users\amonra\AppData\Roaming\npm;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\Llvm\bin;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\VC\Linux\bin\ConnectionManagerExe;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\vcpkg

D:\Github\qt-build>dir "c:\Program Files (x86)\GnuWin32"\bin
 Volume in drive C has no label.
 Volume Serial Number is 7681-4560

 Directory of c:\Program Files (x86)\GnuWin32\bin

01/12/2024  12:16    <DIR>          .
01/12/2024  12:15    <DIR>          ..
04/05/2009  20:17           279,552 bison.exe
01/12/2024  12:15                54 bison.yacc
07/04/2004  21:56           170,496 flex++.exe
07/04/2004  21:56           170,496 flex.exe
31/10/2004  18:51           103,424 gperf.exe
14/03/2008  22:21         1,008,128 libiconv2.dll
06/05/2005  19:52           103,424 libintl3.dll
02/04/2009  23:15           179,200 m4.exe
24/10/2007  10:10            79,360 regex2.dll
01/12/2024  12:15                54 yacc
              10 File(s)      2,094,188 bytes
               2 Dir(s)  632,175,030,272 bytes free

D:\Github\qt-build>flex
'flex' is not recognized as an internal or external command,
operable program or batch file.

D:\Github\qt-build>bison
'bison' is not recognized as an internal or external command,
operable program or batch file.

clearly Windows 11 is choking on the long path variable????? Bets on 2048 bytes?

Is there any solution for this?

Winver says: 23H2 (OS build 22631.4460)

David
 

My Computer

System One

  • OS
    Windows 11 for Workstations
    Computer type
    Laptop
    Manufacturer/Model
    Dell Precision 7750
    CPU
    Xeon W-11885M
    Motherboard
    Dell
    Memory
    128GB

My Computer

System One

  • OS
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    HP Pavilion
    CPU
    AMD Ryzen 7 5700G
    Motherboard
    Erica6
    Memory
    Micron Technology DDR4-3200 16GB
    Graphics Card(s)
    NVIDIA GeForce RTX 3060
    Sound Card
    Realtek ALC671
    Monitor(s) Displays
    Samsung SyncMaster U28E590
    Screen Resolution
    3840 x 2160
    Hard Drives
    SAMSUNG MZVLQ1T0HALB-000H1
I'm not sure this is okay in a path environment variable:

[COLOR=rgb(184, 49, 47)]C:\Program Files(x86)\GnuWin32\bin;[/COLOR]

Try removing the color attributes. That is, change it to this:

C:\Program Files(x86)\GnuWin32\bin;

You also have duplicates. A path only needs to be in the System path or User path, not both. And it looks like some installers did not normalize case when checking if a path is already added. Here are the dups I spotted (there may be more):

C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin;
C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin\;

C:\Program Files (x86)\Visual Leak Detector\bin\Win32;
C:\PROGRAM FILES (X86)\VISUAL LEAK DETECTOR\BIN\WIN32;

C:\Program Files (x86)\Visual Leak Detector\bin\Win64;
C:\PROGRAM FILES (X86)\VISUAL LEAK DETECTOR\BIN\WIN64;

C:\WINDOWS;
C:\WINDOWS;

C:\WINDOWS\system32;
C:\WINDOWS\SYSTEM32;

C:\Windows\System32\OpenSSH\;
C:\WINDOWS\System32\OpenSSH\;

C:\WINDOWS\System32\Wbem;
C:\WINDOWS\SYSTEM32\WBEM;

C:\WINDOWS\System32\WindowsPowerShell\v1.0\;
C:\WINDOWS\SYSTEM32\WINDOWSPOWERSHELL\V1.0\;

There's also a good chance you've got paths in there that are no longer needed.
 

My Computer

System One

  • OS
    Windows 10/11
    Computer type
    Laptop
    Manufacturer/Model
    Acer
I'm not sure this is okay in a path environment variable:

[COLOR=rgb(184, 49, 47)]C:\Program Files(x86)\GnuWin32\bin;[/COLOR]

Try removing the color attributes. That is, change it to this:

C:\Program Files(x86)\GnuWin32\bin;
Don't forget to add the space before "(x86)". For the Visual Leak Detector, you're adding both a 32-bit and 64-bit path. It's highly unlikely you (or your tools) are using both variants at the same and can drop one of them.

I recommend RapidEE tool, for managing such a complex list of PATH's.
 

My Computer

System One

  • OS
    Windows 7
Don't forget to add the space before "(x86)". For the Visual Leak Detector, you're adding both a 32-bit and 64-bit path. It's highly unlikely you (or your tools) are using both variants at the same and can drop one of them.
Good catch!
 

My Computer

System One

  • OS
    Windows 10/11
    Computer type
    Laptop
    Manufacturer/Model
    Acer
I highlighted the directory in path to show that it was there, the colour stuff isn't in the setting of path.

I de-duped a number of things after my initial post. Good call about the missing space before (x86) - that makes a difference!

D.
 

My Computer

System One

  • OS
    Windows 11 for Workstations
    Computer type
    Laptop
    Manufacturer/Model
    Dell Precision 7750
    CPU
    Xeon W-11885M
    Motherboard
    Dell
    Memory
    128GB

Latest Support Threads

Back
Top Bottom