# How to get a specified file extracted from a JAR file using a batch file?

I have a test.jar file on windows and I want to use 7-zip to get a certain file from outside of the archive, such as the "com/app/test/FILE.class" file. I only have access to java, 7-zip, and the regular DOS utilities from the batch file. How can I accomplish this? Should I unzip , search through it, pull it out, then delete the temp files? What is the best way? I am unable to find very much info on the 7-zip 'e' command capabilities.

This didnt work:

7z.exe -e test.jar -x com\app\test\FILE.class

-

To extract FILE.class directly to current directory:

7z.exe e test.jar com\app\test\FILE.class


To extract file to com\app\text\FILE.class in current directory (folders will be created if they don't exist):

7z.exe x test.jar com\app\test\FILE.class

-

Have you tried 7z.exe e (without the '-')? According to the extract command description you don't need the hyphen.

-