0

I need command line to list all files inside folder from many directories like :

C:\Program Files\folder1
D:\Data\folder2

I want to do it with single command line, is there a way to do it? Thanks for the help

  • 1
    Sure, `dir "C:\Program Files\folder1" D:\Data\folder2` and so on. There can be multiple folder paths without or with wildcard patterns specified on a single __DIR__ command line. Open a [command prompt](https://www.howtogeek.com/235101/), run `dir /?` and read the output help. The command `help` outputs an incomplete list of [Windows Commands](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/windows-commands) with brief description. Run `cmd /?` for help on Windows command processor itself explaining also when `"` must be used around a file/folder name. – Mofi Jul 20 '20 at 11:55

1 Answers1

1

The below post gives the solution for your scenario.

dir /s /b /o:gn

/S Displays files in specified directory and all subdirectories.

/B Uses bare format (no heading information or summary).

/O List by files in sorted order.

Thanks to this post.