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:
- install 7z in your machine
- set the path in Environment Variables -> User Variables
- path -> edit -> new (add the path – C:\ProgramFiles\7-Zip) -> OK
Now to use 7z in git bash –
- Go to C:\Program Files\7-Zip and copy 7z.exe file
- Go to C:\Program Files\Git\usr\bin and paste 7z.exe file
Now, you will be able to use 7z with Git Bash
Best Answer
Doing the following in a command prompt works for me, also adding to my User environment variables worked fine as well:
You should see as output (or something similar - as this is on my laptop running Windows 7):