Splitting Large Files Using 7 ZIP Command Line for SkyDrive / OneDrive

If you use SkyDrive or some other file sharing servicing, you may have realized that these services come with upload restrictions. SkyDrive is 2GB and Google Drive is 10GB (Microsoft are you listening?) 7zip, my favorite & free file compression utility, offers to split large files into multiple smaller ones based on a maximum file size.(Did I mention it is free?) This is real easy to do in the full 7zip software as shown below. Any files over 2GB are split into file.7z.001, file.7z.002, file.7z.003 (not their real names). You can later use the 7zip program to recombine them into one file or directory again. Right click the file you wish to be smaller so it uploads successfully & select Add to Archive. The specify in the Split Volume bytes field a value of 2GB or in the case of SkyDrive/OneDrive 1900M to be safe & below the threshold.

Option to Split Files in 7zip

Option to Split Files in 7zip

But how do you do this from the command line? Well with thanks to a little help from this link http://informationworker.ru/7zip.en/cmdline/switches/volume.htm we van now specify a maximum volume size in 7zip. Enter -v switch. Here is the syntax: -v{Size}[b | k | m | g] Here b is bytes, k is kilobytes, m is megabytes & you guessed it, g is gigabytes. So it could potentially look something like this 7z a a.7z *.txt -v10k -v15k -v2m. Just add a -v switch with a number and data measurement behind it. -v11k is 11 kilobytes before 7zip splits it. -v2g is 2GB before 7 zip splits it. Or in my case when using SkyDrive something like this. (Note: Skydrive/OneDrive does not like folks going over 2GB on uploads, so set yours to about 1900m to be safe.)

cd /D E:SkyDrive

for /d %%X in (*) do C:Batch7za9207za.exe u “E:SkyDriveArchive%%X.7z” “%%X” -y -mx9 -mmt –v1900m -we:temp


So now you can always have an archival copy of all your data on SkyDrive, but be warned, you may have a lot of split files to merge back together if you ever need to restore them.



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s