7-Zip not working from the DOS prompt or command line?
Sophia Terry
I have 7-Zip installed, and it works from Windows, but not from the DOS prompt or command line:
7z e max_logs_can_messages.tgzYields:
'7z' is not recognized as an internal or external command,
operable program or batch file. 3 5 Answers
You'll need to add the binary to your machine's PATH
See more here:
2You can either copy 7-Zip to a well-known path like these:
C:\Windows\system32
C:\Windows
C:\Windows\System32\Wbemor you call 7-Zip with the full path:
C:\Program Files\7-Zip\7z.exeOr you do the thing Screenack said ;)
1You need to register 7-Zip as a system PATH environment variable. An easy way to do this in Windows 7 & 8 is to run this from the command line:
setx path "%path%;C:\Program Files\7-Zip" You need to add the 7-Zip folder to your PATH:
setx /M path "%path%;C:\Program Files\7-Zip\"Alternatively, for Easy 7-Zip:
setx /M path "%path%;C:\Program Files\Easy 7-Zip\" 2 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:\Program Files\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