1

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/

nephewtom
  • 2,941
  • 3
  • 35
  • 49
  • To troubleshoot, try uninstalling antivirus and disabling UAC, if you suspect these might be issue. That will help either eliminate them or confirm. FWIW, it's running here with scoop with no trouble. – Andrew Savinykh Jan 17 '20 at 00:02
  • Not sure what happened, but `git.exe` was spawning like hell in many, many processes... I somehow fixed uninstalling it from scoop and reinstalling it again. – nephewtom Jan 20 '20 at 10:02

1 Answers1

0

You have to download git prtable version from here then extract the file using 7-Zip to the following path "C:\Users\YOUR_USERNAME\scoop\apps\git\2.25.0.windows.1" to replace the version that not working in scoop.

Don't forget to check the correct path....