How to get list (full path) of files exist in folder and subfolder in cmd

3.4k Views Asked by At

I would like to get the list of files exist in folder and subfolder with full path.Don’t want any blank folder or subfolder path in list.

Example. (File exist on path) ~\Folder1 \Subfolder1 \File1.jpg

(No file on this path, blank folder) ~\Folder2 \Subfolder2\

(File exist on path) ~\Folder3 \Subfolder3 \File3.png

*Result .\Folder1\Subfolder1\File1.jpg .\Folder3\Subfolder3\File3.png

I tried dir /s /b>list.txt command in cmd but also getting path on blank folder path that I don’t want.

1

There are 1 best solutions below

0
Wisblade On

Simply ask dir to remove directories... Being a directory is considered as an attribute.

dir /s /b /a:-D > list.txt