7zip: compress and copy to destination folder

8,554

Compress and copy to destination folder

Use the following command:

7z a C:\DestinationFolder\file.7z c:\file.mdb

Notes:

  • a is add
  • See link below for the full manual for the command line version of 7z.

Further reading

Share:
8,554

Related videos on Youtube

Isaiah Melendez
Author by

Isaiah Melendez

Updated on September 18, 2022

Comments

  • Isaiah Melendez
    Isaiah Melendez over 1 year

    I am trying to do the following: command line compress a file from C:\TestFolder\file.txt (source location) and on the same command or bat file put that compressed file in (a destination folder) C:\DestinationFolder\file.7z.

    My scenario applies to our real life point of sale system. We have an .mdb file that lives in a folder in the C:\ and I need to compress and copy the compressed file to a destination folder in the C:\. However, we do not want anything to occur to the original .mdb file in the source folder.

    Let me know if I need to further clarify.

  • Isaiah Melendez
    Isaiah Melendez over 8 years
    If I create a batch file for this and create a scheduled task will I run into any issues if the user on the PC is not logged in? I have had bad experiences with scheduled task that is why I am wondering if this is possible.
  • DavidPostill
    DavidPostill over 8 years
    @IsaiahMelendez It should be fine. Try it, and if you can't get it working ask a new question.