Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Zip using batch file help  (Read 5256 times)

0 Members and 1 Guest are viewing this topic.

harsha.ganapathy

    Topic Starter


    Starter

    • Experience: Experienced
    • OS: Windows 7
    Zip using batch file help
    « on: June 16, 2016, 05:54:58 AM »
    Hi,

    I need to create a batch file which will take the file from specified folder and then zip it with password protection.

    However, below code is not doing what I need. Please help.

     @echo off
    pushd "C:\Users\harsha.ganapathy\Desktop\BODS Encryption"
    "C:\Program Files\WinZip\WINZIP64.EXE" -a "C:\Users\harsha.ganapathy\Desktop\BODS Encryption\Sample.zip" -spassword -yc *.xlsx
    popd

    Winzip opens up with error and on clicking no, i get the zip file but without passoword protection. Need inputs.

    Thanks in advance.

    Squashman



      Specialist
    • Thanked: 134
    • Experience: Experienced
    • OS: Other
    Re: Zip using batch file help
    « Reply #1 on: June 16, 2016, 06:32:36 AM »
    Use the command line client.
    http://www.winzip.com/downcl.html

    harsha.ganapathy

      Topic Starter


      Starter

      • Experience: Experienced
      • OS: Windows 7
      Re: Zip using batch file help
      « Reply #2 on: June 16, 2016, 07:16:41 AM »
      should i modify anything in code. I just installed and still its the same issue.

      Is it just possible to encrypt the file and not zip it.?

      Just password protect the excel file?

      patio

      • Moderator


      • Genius
      • Maud' Dib
      • Thanked: 1769
        • Yes
      • Experience: Beginner
      • OS: Windows 7
      Re: Zip using batch file help
      « Reply #3 on: June 16, 2016, 07:19:23 AM »
      Why not password protect it in Excel before you zip it ? ?
      " Anyone who goes to a psychiatrist should have his head examined. "

      harsha.ganapathy

        Topic Starter


        Starter

        • Experience: Experienced
        • OS: Windows 7
        Re: Zip using batch file help
        « Reply #4 on: June 16, 2016, 07:33:47 AM »
        Its complicated. One of SAP Application schedules and generates report in excel and places it in portal. We need a script to automate it to make it password protected.

        Squashman



          Specialist
        • Thanked: 134
        • Experience: Experienced
        • OS: Other
        Re: Zip using batch file help
        « Reply #5 on: June 16, 2016, 02:13:14 PM »
        should i modify anything in code. I just installed and still its the same issue.
        Well you just installed a different program.  So yes.  You need to use the correct executable and the correct options.  If you look in your Start > Programs > Winzip, you will see a help file for the Winzip Command line add-on.