+ Reply to Thread
Results 1 to 1 of 1

how to extract a list of all the files and folders within a Windows OS folder onto Excel

  1. #1
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,417

    how to extract a list of all the files and folders within a Windows OS folder onto Excel

    on a Windows OS machine, let us say you want to extract all the files and folders within a folder called "Test" in the Root of your C Drive (C:\Test).

    go to Run > cmd.

    when the DOS window opens, do the following:

    cd\
    hit ENTER

    cd Test
    hit ENTER
    dir /s > extract.csv
    hit ENTER

    that's it, the CSV file is created within the Test folder. open the CSV file in Excel.

    you could experiment more with the switches for DIR command (by using the dir /? command), such as the /b, which provides the information in a different format and layout. you could club these two switches together in one, for e.g.:

    dir /s /b > Test.csv

    the /s switch helps in extracting files from within subdirectories (sans which only the file(s) in the root of the Test folder will be listed). the /b switch gets rid of a lot of superfluous information and gets right to spitting out the "folder\filename" data.

    if you were to execute "dir /s /b" all by itself, the information would be displayed on the terminal (monitor / screen). what the ">" does is to spit that out into a flat file.
    Last edited by icestationzbra; 07-15-2012 at 10:42 AM. Reason: corexn
    - i.s.z -
    CSE, aka Array aka { }, formulae are confirmed with CONTROL+SHIFT+ENTER.
    Replace commas ( , ) with semicolons ( ; ) in formulae, if your locale setting demands.
    All good ideas are courtesy resources from this forum as well as others around the web.
    - e.o.m -

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1