Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / operating-systems / Windows

Joining Binary Files from a bat File Without Extra Programs

5.00/5 (4 votes)
11 Sep 2013CPOL 30K  
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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)