Today I started experiencing this error on Windows 10 CMD terminal:
C:\WINDOWS\System32>git.exe --version
error reading exit code: The handle is invalid.
C:\WINDOWS\System32>where git.exe
C:\Users\etomort\scoop\shims\git.exe
My git installation as well as many other programs were installed via scoop installer.
Unfortunately, this error has broken my git installation, scoop (which needs git), and some other things like IntelliJ connection with git.exe.
I have downloaded a Portable git and that seems to work.
C:\PortableGit\bin>.\git.exe --version
git version 2.25.0.windows.1
But I depend a lot on scoop, which stopped to work.
What are the possible reasons and solution for this failure?
I have googled a bit, and possible causes are UAC and/or antivirus.
The laptop belongs to my company and it could be due to a silly internal policy.
UPDATE: My laptop got an update just before start failing...
It might be a faulty Windows 10 update, as described in this link
https://appuals.com/the-handle-invalid/