Skip to main content

Merge multiple files into one new file in Windows

A quicky: if you need to merge multiple text files into one new file in Windows, you can use the copy command in cmd.exe, and here is how:

How to merge or combine multiple files

Here is how to merge a text (.txt) file in the Windows command-line (cmd.exe) environment.

In your Windows cmd.exe command-line, use the following single command to merge all text files in a directory into one new file:

copy /b *.log newfile.log
copy /a *.txt newfile.txt

The copy parameters /a and /b indicate ASCII text or BINARY files.

This is ideal for combining multiple log files into one file for LogParser and log forensics.

I thought you might find this interesting:   How to block BaiduSpider bot User-Agent

Jan Reilink

My name is Jan. I am not a hacker, coder, developer, programmer or guru. I am merely a system administrator, doing my daily thing at Vevida in the Netherlands. With over 15 years of experience, my specialties include Windows Server, IIS, Linux (CentOS, Debian), security, PHP, websites & optimization.

Hi! Join the discussion, leave a reply!