Windows Batch script snippets

How to print a list of file to a TXT

You just have to copy the following code and past into Notepad, then save with .bat extension and execute it from the path you want to map.

Both of the following snippets will include subfolders.

Print only file name

dir /b > FilesList_C.txt

Print file name and details

dir /b /s > FlesList_A.txt
Nicola Simboli

Nicola Simboli Senior Analytics Engineer

15+ years across SaaS, enterprise and consulting. Focused on scalable data platforms, metric reliability and analytics systems that teams actually use.

Back to Windows Batch script cookbook page