The proper way is indeed to do a for loop. And the program type writes the input file on stdout, which is then redirected into the end of the target file, so as to accumulate everything in it. If anyone is interested, the equivalent in Linux would be
But you can also solve the first problem the dumb way, not involving any command line at all. Just type Windows+F to open up the Find program. And find the files matching *.pgn in the specified folder (incl. sub-folders). Once files have been found just select them (Ctrl+A) and use copy/paste or drag/drop to put them uin the folder of your choice.
Now for the second problem (file concatenation), I can't think of a "dumb way" for that. Really it has to be command line.
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
JBNielsen wrote:Just to be sure - do I make a bat-file with these commands, or is it better done in another way?
I would put it into a .bat file. (No, I would use another script language like Perl or Shell but that's another issue )
The first version might take targetDir as parameter.
The second version might take no parameters at all if you remove the ">>%targetFile%" part, then you could simply call the .bat script and optionally append any output redirection as you like directly on the command line, in this case ">whatever" would be sufficient. In my example the ">>" was needed since that occurs within the loop and a single ">" would cause multiple overwriting of the output file with each new file, instead of concatenating.