Guide: Automatically Zip, Split, and Transfer Files

If you need to copy many small files over a network, it can take a long time even with multi-thread copying. This guide will show you how to add an entry to the TeraCopy drag-and-drop confirmation dialog for a batch file that will:

  • Launch 7-Zip to compress and split files into 10 GB volumes.
  • Use TeraCopy to copy the archive(s) to the target folder.

Save this code to the 7zipCopy.bat file:

@echo off
setlocal enabledelayedexpansion

REM Check if the correct number of arguments is provided
if "%~1"=="" (
    echo Usage: 7zipCopy.bat input_file.txt temp_folder target
    echo 1. 7-Zip will pack files listed in 'input_file.txt' to 'temp_folder'.
    echo 2. TeraCopy will copy 'temp_folder' to 'target'.
    exit /b 1
)

REM Set variables
set input_file=%~1
set outputDir=%~2
set target_path=%~3
set output_file=output_paths.txt
set zip_prefix=archive

REM Check if the input file exists
if not exist "%input_file%" (
    echo Input file not found: %input_file%
    exit /b 1
)

REM Check if the temp folder exists
if not exist "%outputDir%" (
    echo Temp folder not found: %outputDir%
    exit /b 1
)

REM Ask user whether to clear the temp folder
echo Temp folder: %outputDir%
set /p clear_temp=Delete all files in this folder (Y/N)? 

if /i "!clear_temp!"=="Y" (
    echo Clearing temp folder...
    del /q "%outputDir%\*"
    if %errorlevel% neq 0 (
        echo Failed to clear the folder.
        exit /b 1
    )
    echo Temp folder cleared.
) else (
    echo Temp folder not cleared.
)

REM Initialize the zip file name
set zipFileName=%outputDir%\%zip_prefix%.zip

REM Store files with no compression (-mx0) in 10 GB volumes (-v10g)
"C:\Program Files\7-Zip\7z.exe" a -tzip -mx0 -v10g "%zipFileName%" "@%input_file%" -bb

if errorlevel 1 (
    echo Compression failed.
    pause
    exit /b 1
)

"C:\Program Files\TeraCopy\TeraCopy.exe" copy "%outputDir%" "%target_path%"

Press Win+R, type %APPDATA%\TeraCopy and press Enter.

Add this text to the end of PasteMenu.ini file:

[5]
title=7zip + Copy
path=cmd.exe
parameters=/K C:\Your\Path\7zipCopy.bat "{list}" "C:\Temp\Archive" "{target}"

Replace C:\Temp\Archive with any existing empty folder.

After the copy, you can unpack the archive(s) on the destination machine.

New Year Sale & Upcoming TeraCopy Features

We are offering a 50% discount starting today through January 7 on all our software. Please use the coupon NEW-YEAR on this page.

Upcoming TeraCopy Features

We have made progress in creating a foundation of a multi-thread copy system that allows for reading once and writing to one or multiple targets, as well as reading from multiple threads and writing using one thread for HDD/tape. However, we still have a lot of work ahead of us due to major changes in the copy engine. We estimate that a beta version will be available in a couple of months.

TeraCopy 3.17

Changelog:

  • Clone & Rescan feature.
  • Added xxHash support for SSE2 processors.
  • Upgraded reporting and checksum export features.
  • Implemented network recovery wait function during testing and verification.
  • Expanded maximum buffer capacity to 256 MB.
  • Resolved minor bugs and improved user interface design.

Download: teracopy3.17.exe


Black Friday Sale

Starting now, and running through December 1st, we are offering 50% off all our software. Just use coupon code BLACK-FRIDAY during checkout.

The fine print:
– After you purchase TeraCopy Pro it may be used indefinitely.
Upgrades to future versions of the software will be free for the lifetime of the product.
– TeraCopy Pro is licensed per user, so if more people are going to use TeraCopy Pro you will need to purchase additional copies.
– Each license allows installation on all owned computers, and TeraCopy Pro may be used at exactly the same time on each of them.
– Transfer of a license to another owned computer is allowed.
– License activation isn’t required.