I'm trying to merge txt files in a dir using the following
@echo off
cd /d C:\textfiles\
for %f in (*.txt) do type "%f" >> C:\Users\Desktop\output.txt
But I am not getting any output (because last line I'm pretty sure) , can anyone help me out here?
Also how can I make the output filename automatically append text or date for the date e.g. output_random.txt or output_19.06.14.txt ?
Edited code (thanks to Stephan) but not appending date:
@echo off
cd /d "C:\TextFiles"
for /f %%i in ('wmic os get localdatetime ^|find "20"') do set dt=%%i
set dt=%dt:~0,8%
for %%f in (*.txt) do type "%%f" >> C:\TextFiles\output-%dt%.txt