I try to unzip a file via CMD.
So I install WinZip (and its plugin to cmd), WinRAR, and 7-zip.
But when I try to execute a command via the CMD:
7z e myzip.zip
It gives the next error:
7z is not recognized as an internal or external command
In addition, I added the folder of 7-z to the environment variables (Properties--> advanced --> Environment Variables --> user variable --> choose path, and add C:\Program Files\7-Zip
What can be the reason?
I find the below solution for this.
while zipping in cmd or git bash - getting error like
7z:command not found
solution:
Now to use 7z in git bash -
Now, you will be able to use 7z with Git Bash
Regarding Phil Street's post:
It may actually be installed in your 32-bit program folder instead of your default x64, if you're running 64-bit OS. Check to see where 7-zip
is installed, and if it is in Program Files (x86)
then try using this instead:
PATH=%PATH%;C:\Program Files (x86)\7-Zip
make sure that your path is pointing to .exe file in C:\Program Files\7-Zip (may in bin directory)
In Windows 10 I had to run the batch file as an administrator.
Source: Stackoverflow.com