I have a strange issue with both CMD and Powershell on Windows 10 that has been giving me some trouble. An unrelated scriptwas failing when running curl, and after some investigation it looks like a CMD and Powershell issue.
When I run curl in CMD, I get the following error:
C:\Users\****>curl
Cannot find file at '..\\lib\curl\tools\curl-8.6.0_1-win64-mingw\bin\curl.exe' (C:\WINDOWS\lib\curl\tools\curl-8.6.0_1-win64-mingw\bin\curl.exe). This usually indicates a missing or moved file.
The same happens in PowerShell, though in that case I have to write curl.exe (plain curl aliases to Invoke-WebRequest).
This path does not exist. It is not present in PATH (or any other environment variable), either, and I can't figure out why CMD/Powershell is trying to look for curl there. I have tried putting C:\Windows\System32 (where curl is actually located) at the beginning of PATH, but this didn't work.
Confusingly, where works just fine and doesn't show anything weird:
C:\Users\****>where curl
C:\Windows\System32\curl.exe
Any help is appreciated, let me know if I need to provide some more information.
HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\curl.exeexists via regedit? The error message is definitely neither Cmd nor PS; you're somehow running a Chocolatey shim .exe (which exists somewhere on your system, but its job is to run another .exe that doesn't exist). – u1686_grawity Mar 27 '24 at 09:54%WinDir%- that is never the way to install software (except for driver installations and the handful of user modifiable config files within%WinDir%\System32\drivers\etc,%WinDir%is off-limits for modifications - this explains why). There are five default locations for installing software:%ProgramFiles%,%ProgramFiles(x86)%,%ProgramData%,%LocalAppData%, and%AppData%. If Chocolatey has been installed, or is installing software, to%WinDir%, it's configured incorrectly. – JW0914 Mar 27 '24 at 12:15