Append files together using windows command line

In the command prompt, an easy way to append files together is to use the “type” command and pipe it to an output file.

type Results_* > Results_combined.txt

To call this from a piece of C# code, I have been using the command line with the /c parameter, which makes it execute the attached command.

cmd /c type Results_* > Results_combined.txt

C# Example usage:

using (Process RunProc = new Process()) {
    string s = "cmd.exe";  
    string p = "/c type Results_* > Results_combined.txt";
    RunProc.StartInfo = new ProcessStartInfo(s, p);
    RunProc.Start();    
    RunProc.WaitForExit();
}