Close Menu
    Facebook X (Twitter) Instagram

    Code Sector Blog

    • Blog
      • TeraCopy
      • Direct Folders
      • AudioField
      • InDrive
      • Maverick
      • Nomad Watch Face
      • SpeedView
    • Products
      • TeraCopy
      • Direct Folders
      • AudioField
      • InDrive
      • Maverick
      • Nomad Watch Face
      • SpeedView
    • Downloads
    • Purchase
    • Support

    Code Sector Blog

    Home»TeraCopy»Guide: Automatically Zip, Split, and Transfer Files
    TeraCopy

    Guide: Automatically Zip, Split, and Transfer Files

    July 6, 2024Updated:July 6, 2024No Comments
    Share
    Facebook Twitter LinkedIn Email Reddit Telegram

    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.

    Windows
    • TeraCopy
    • Direct Folders
    Android
    • AudioField
    • Maverick
    • Nomad Watch Face
    • SpeedView
    • InDrive
    • Droid NAS
    • Neat Calendar
    Recent
    • TeraCopy 4 RC
    • TeraCopy 4 Beta 2
    • New Year Sale
    • Direct Folders 4.3.5
    • Direct Folders 4.3.4
    Subscribe
    Powered by Audienceful
    Windows
    • TeraCopy
    • Direct Folders
    Android
    • AudioField
    • Maverick
    • Nomad Watch Face
    • SpeedView
    • InDrive
    • Droid NAS
    • Neat Calendar
    Recent Posts
    • TeraCopy 4 RC
    • TeraCopy 4 Beta 2
    • New Year Sale
    • Direct Folders 4.3.5
    • Direct Folders 4.3.4
    RSS Feed
    • Subscribe by E-mail
    • Subscribe in a reader
    Recommended
    • Wise: money without borders
    • Airalo: stay connected, wherever you travel
    X (Twitter) YouTube Telegram
    © 2025 ThemeSphere. Designed by ThemeSphere.

    Type above and press Enter to search. Press Esc to cancel.