65.9K
CodeProject is changing. Read more.
Home

Joining Binary Files from a bat File Without Extra Programs

starIconstarIconstarIconstarIconstarIcon

5.00/5 (4 votes)

Sep 7, 2013

CPOL
viewsIcon

30055

How to join binary files without extra software

Introduction

Probably you will have received a set of files that are separated/split (like when you have multiple volumes in a ZIP or RAR file) but that have not been generated through a compression tool.

In those cases, usually the sender recommends to use HJSplit to join those files.

Here you will find a simple batch file sample on how to do that without any program. Simply form the CMD.

Using the Code

As you will see, this is only a special syntax for the copy command in Windows.

In that case, you will take advantage of the /B modifier which indicates copy that the file is binary.

Also, you will use the + sign to join files:

copy filename.iso.001 /B + filename.iso.002 /B filename.iso /B

pause

After executing the previous snippet, you'll get a new file named "filename.iso" which will be the addition of two binary files filename.iso.001 and filename.iso.002.