Hello. I need to join to binary files in *.bat script on Windows. How can I achieve that?
Just use the dos copy command with multiple source files and one destination file.
copy file1+file2 appendedfile
You might need the /B option for binary files
type works similar to cat.
type file1 file2 > file3
Edit: Greg, can you explain what you mean by file headers? (I would just comment but I don't have enough karma yet)
Edit2: The file headers are printed to stderr, so the redirect to the output file works like cat, at least in Windows XP.
Shameless PowerShell plug (because I think the learning curve is a pain, so teaching something at any opportunity can help)
Get-Content file1,file2
Note that type
is an alias for Get-Content, so if you like it better, you can write:
type file1,file2
If you have control over the machine where you're doing your work, I highly recommend installing GnuWin32. Just "Download All" and let the wget program retrieve all the packages. You will then have access to cat, grep, find, gzip, tar, less, and hundreds of others.
GnuWin32 is one of the first things I install on a new Windows box.