Solved How to create batch file using PKZIP or 7z exe

May 11, 2015 at 22:43:54
Specs: Windows 7
I need to create a batch file which will accept the 2 paramaters. First parameter will be path of the file which needs to be zip and second will be path of header file which i need to copy in the same zip file. How to do that?
Currently I am using "7z.exe u -tzip classics.zip classics -r" but i need to pass the file path in the command line

message edited by abhaykk


See More: How to create batch file using PKZIP or 7z exe

Report •


#1
May 11, 2015 at 23:50:22
✔ Best Answer
SET PATH=%PATH%;path to zip file

will add the path to zip file (where you fill in the specific path) to the existing path in a command prompt session. When you close the command prompt window the path will revert to its previous value.

Additional info here:

http://stackoverflow.com/questions/...

Is that what you were looking for?


Report •

#2
May 12, 2015 at 01:25:37
actully my task is like I need to run
c:\>> test.bat <<Path1>> <<Path2>>
Where in batch file i need to use
7z.exe u -tzip C:\abhay\test.zip <<Path1>>
so currently I am using >7z.exe u -tzip C:\abhay\test.zip %1
But its giving error like "7z.exe is not recognized as an internal or external command"

How should i write that?

message edited by abhaykk


Report •

#3
May 12, 2015 at 18:24:40
It's telling you it doesn't know where 7z.exe is. You're providing a path to test.zip but not to 7z.exe. If for example it's in the same directory as test.zip the command line would be:

c:\abhay\7z.exe u -tzip C:\abhay\test.zip %1


Report •

Related Solutions


Ask Question