[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 5355
  • Last Modified:

Using PKZIP commands in a Batch File

Is it possible to write a MS-DOS Batch file which calls the zip software PKZIP and to key in commands in the batch file that executes a zip function using PKZIP?

For example PKZIP test.txt test.zip  &  to zip up a set of files.

Thank You

Your help is much appreciated.
0
ben1211
Asked:
ben1211
1 Solution
 
ChireruCommented:
What exactly did you want it to do?  
If there is a command-line switch for each thing you need to do, then it's very easy to script.
0
 
r-kCommented:
Yes, just put the same commands in the .bat file that you would normally type in at the command line. Test before using, of course.
0
 
SOFTECNICOSCommented:
Well i do a lot of things using the pkzip command in DOS Batch files, but you should consider using other tools that not PKzip, because this tool doesn't support long name files.

But if you go to the notepad, you only need to write some lines
pkzip -es zipfile files to zip

Don't forget to have the pkzip and pkunzip on the windows dir


Best regards
0
 
ben1211Author Commented:
SOFTECNICOS, you mentioned that you used pkzip commands in DOS Batch Files. Suppose I have a directory of files and I want to zip each file individually. Could you give me a batch file for this job?

You also mentioned looking into other tools. What other zip tools would you recommend that can be used with a DOS Batch File, and where can I get these zip tools?

Thank You
0
 
SOFTECNICOSCommented:
Another tool for this kind of task is ARJ32, it works like the same pkzip, but it supports long file names, and better compression ratio.

About your batch file, you have to do the following things

in that directory type

DIR:>dir *.* >batch.cmd
open that bacth.cmd file in excel an eliminate the first lines and the last ones, after that you only have to complete the columns on Excel like if you have the command typed in MS-DOS

The arj32 syntax is ver easy
and here goes an example:

arj32 u -y arjfile file (s) to be archived


I realy hope this helps
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now