list_all_files.bat:
dir /b /s * >temp.txt
dir * lists the content of the current directory. /b switch makes it to use bare format (report does not include heading information or summary). /s instructs it to use recursion. >temp.txt instructs it to output report to temp.txt file.
After running it, this is the content of temp.txt:
C:\test\list_all_files.bat
C:\test\mydir
C:\test\temp.txt
C:\test\mydir\a.txt
C:\test\mydir
C:\test\temp.txt
C:\test\mydir\a.txt
Links and references:
Microsoft DOS dir command
No comments:
Post a Comment