PDA

View Full Version : Split a file with bat


Lucas65
10-04-2016, 15:26
Hello,
I wanted to ask for advice on a command in bat.
If I have a compressed folder that weighs 500mb But when I start compressing I wanted to create 5 files from 100mb (data1.bin - data2.bin etc.) Instead of a single file (data1.bin) that weighs 500mb there is a command to use in cmd accompanied by, I assume, split.exe to do this?
I know there are utilities like ultrarc that do this but I'd like to know if you can do with the bat file.

Thank you and good day!

ChronoCross
10-04-2016, 20:43
split.exe

split
@echo off
title Split
rem "Number 3 means 3mb"
for /r . %%T IN ("dat_0*.bin") do (
split s "%%T" 50 "%%~nT.part*"

cls
)

del dat_0*.bin



rem --------------- drag and drop with
rem split s "%~nx1" 3
rem del "%~nx1"

merge

@echo off

title merge
for /r . %%T IN ("dat_0*.part1") do (
split m "%%T" "%%~nT.bin"
cls
)

del dat_0*.part*

Lucas65
11-04-2016, 06:22
Thank you very much Chrono Cross, but it was not what I was looking for.
For example: I'm compressing a game of 700mb. During compression I would create 10 files to 70MB to each one (data1.bin - data2.bin - data3.bin etc.).
Basically a command to add to msc+srep+lzma to create, instead of a single compressed file, some file from 70MB.

I hope I explained a bit better. Thanks for your help!

ChronoCross
11-04-2016, 06:43
Freearc not have multi volumen. This is the only way for now. Razor its working on this solution. You can use felice tool or use 7z.

Lucas65
11-04-2016, 10:07
I understand, FreeArc not have multi volume.
Thanks for the help!
Hello.

gozarck
06-05-2016, 17:54
this is an experimental batch to split folder by size and pack with arc.exe.
default is -m0 for test.

( felice tool is the best way for split and compress folders.)

felice2011
07-05-2016, 00:42
...@gozarck ...In fact it is the same concept used in the utility "M&S Kompressor" and I think also in "UltraARC" by Razor.
If you want to split the archive already created in exact portions maintaining the same extension of the archives, with the possibility of changing file extension by joining the archives you can use this experimental.

The only downside for extracting using an installer must first join the splitted archives, and then install, and therefore requires a double size of the size of the extracted files to a temporary folder.

Razor12911
07-05-2016, 08:20
or use UltraARC