I have the following code...
FOR /f "delims=" %%f in ('dir /b /a-d-h c:\source\*.*') DO (
Echo %%f >> Output
I know nothing about DOS but am looking to expand this in some way so that I can get both the file path and its name in separate variables? I also need a way of determining whether I am iterating on the first file in the loop - if so I want to use > to echo to a fresh file - otherwise I want to use >> to append to the file? Any ideas?