How to list folders in a directory and generate a file_list for that

Posted: February 5, 2011 in Software

Ever wonder how to do that without laboriously type one by one?

The solution is extremely simple.

Let say, I want to list all my folders in H:/Games/Single Player (PC),

  1. Open Command Prompt (Type CMD in run)
  2. Go to H:/Games/SinglePlayer (Refer Screenshot 1)
  3. Type dir /a /b /-p /o:gen >filelisting.txt

Viola. A list of folders is nicely generated. (Refer Screenshot 2)

Screenshot 1







Screenshot 2

  1. menerc says:

    Nice. Is it possible to make it recursive? (Like listing files in subfolders)

  2. expertester says:

    dir /s /b>FileList.txt

    You will get all the file/folder recursively..but the output is not as clean as the above method.

  3. scoring says:

    This piece of writing iis truly a pleasant one it helps new internet visitors, who are wishing for blogging.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s