1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Drag and Drop Batch Script + 7zip to compress files and directories

Discussion in 'Programming' started by Cleptography, Sep 6, 2010.

  1. Cleptography

    Cleptography New Member

    Joined:
    Sep 2, 2010
    Messages:
    39
    Likes Received:
    7
    Trophy Points:
    0
    This simple one liner is a drag and drop script.
    It assumes that you have 7zip and it is located in your path, if not add the the directory to your path variables, or put 7z.exe and 7z.dll in the desired directory with this script.
    Simply drag your file or directory over the batch to compress files.

    Code:
    @echo off
    
    ::
    REM This is a drag and drop script that uses 7zip to compress files
    REM Simply drag the file or directory over this script to compress it
    ::
    
    7z a %1.7z %1
    
    PAUSE
     

Share This Page