Dir command Output into a Text file
Posted: 29 Jan 2010 12:56
I'm having trouble getting files names to be outputted into a text file. As of now I can only get the directory names to be outputted and not the files within. Right now I have:
FOR /D %%I IN ("\\server\data\jan-2010\*") DO dir /b "%%I" >> "%userprofile%\desktop\output.txt"
The above code just copies the directory names within the "jan-2010" folder. I need it to copy the file names within those directories into the text file. I'm stumped.
Any help would be appreciated.
Thanks!
FOR /D %%I IN ("\\server\data\jan-2010\*") DO dir /b "%%I" >> "%userprofile%\desktop\output.txt"
The above code just copies the directory names within the "jan-2010" folder. I need it to copy the file names within those directories into the text file. I'm stumped.
Any help would be appreciated.
Thanks!