What you want can be achieved with the tree command .
tree : Allows the user to view a list of files and folders
in an easy to read list.
using the following options:
/ f : Display the file names in each directory
/ a : extension characters used to link lines, instead of graphic characters. / a is used with code pages that do not support graphic characters and to send results to printers that do not interpret graphic characters correctly.
This would be the call:
tree <Directorio> /f /a > Listar.txt
More information: tree command (English)
This is an example of how it would be saved in your file:
Volume serial number is 1A4C-12AB
C:\myData\
| art_dum.png
| cockpit.png
|
| \---particles
| | default.html
| |
| +---css
| | doc.txt
| | site.min.css
| |
| +---fonts
| | +---Material
| | | MaterialIcons-Regular.eot
| | | MaterialIcons-Regular.ttf
| | | MaterialIcons-Regular.woff
| | | MaterialIcons-Regular.woff2
| | |
| | +---NimbusMono
| | | nimbusmono-regular-webfont.ttf
| | | nimbusmono-regular-webfont.woff
| | | nimbusmono-regular-webfont.woff2
| | |
| | \---roboto
| | Roboto-Bold.woff
| | Roboto-Bold.woff2
| | Roboto-Light.woff
| | Roboto-Light.woff2
| | Roboto-Medium.woff
| | Roboto-Medium.woff2
| | Roboto-Regular.woff
| | Roboto-Regular.woff2
| |
| \---js
| site.min.js
| |
\---tototita
archivo.bat