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.