Using PKZIP commands in a Batch File

Posted on 2005-04-24
Last Modified: 2011-09-20
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  &  to zip up a set of files.

Thank You

Your help is much appreciated.
Question by:ben1211
    LVL 5

    Expert Comment

    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.
    LVL 32

    Expert Comment

    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.
    LVL 2

    Accepted Solution

    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

    Author Comment

    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
    LVL 2

    Expert Comment

    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

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    Suggested Solutions

    NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
    In the modern office, employees tend to move around the workplace a lot more freely. Conferences, collaborative groups, flexible seating and working from home require a new level of mobility. Technology has not only changed the behavior and the expe…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now