name and size (bytes) of files in folders/subfolders in excel sheet

Posted on 2012-08-27
Last Modified: 2012-09-01

I want to get name and size (bytes) of files in folders/subfolders in an excel sheet. How can I do that?
Question by:baberamin
    LVL 22

    Assisted Solution

    Can this help?



    1. Open a command line window by clicking "Start" on the task bar, clicking "Run" in the start menu and then entering "cmd" in the Run box that appears.
    2. In the command line, navigate to the folder containing the items you want to list using the CD command (for example, CD \ will move to the root folder, or use CD \<folder> to move to the given folder).
    3. Run the following DIR command: "DIR *. > list.txt" to generate a list of all files with no extension (a list of just the folders) and save it in the file list.txt. The DIR command has many other parameters that can be applied to give listings in different formats, different sort orders and to even list files in all sub-folders. Use the command "DIR /?" to get a summary of the options.
    4. Locate the file list.txt on your computer and right-click on it. From the pop-up menu, click "Open With," then click on "Choose Program." In the Choose Program dialog, locate Microsoft Word and click on it. Click "OK." The file can now be edited and formatted just as any other Word document.
    5. Open the output file in Excel by first launching Excel, then click on the "Data" tab at the top and click the "From Text" button.
    6. Browse to the output file and double-click on it. In the "Import Text Wizard" dialog that comes up, choose the "Fixed Width" option and click the "Next" button. On the next screen, in the "Data preview" portion, click on the line at position 50 and drag it off of the white area to remove it. When the lines are positioned correctly, click "Next." Click the "Finish" button to finish the text import wizard. The file will now be imported with the file date in column A, the time in column B, the file size in column C and the file name in column D.

    Read more: How to Convert a Folder List Into Word or Excel |
    LVL 76

    Expert Comment

    Are you familiar with vbscript?
    You can add attribute to get the size of the file and whatever other Parameters you want.
    LVL 1

    Accepted Solution

    With the Swiss File Knife command line tool, it's
    sfk list -size -tabs mydir +tofile out.csv
    to list all files of mydir, including subfolders, with their sizes as tab separated CSV data. just import or open the created out.csv with Excel. When asked for a separator character, select Tab.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Java/J2EE and SOA

    This course will cover both core and advanced Java concepts like Database connectivity, Threads, Exception Handling, Collections, JSP, Servlets, XMLHandling, and more. You'll also learn various Java frameworks like Hibernate and Spring.

    Suggested Solutions

    Title # Comments Views Activity
    Inventory 1 42
    zeroFront challenge 7 58
    canBalance challenge 34 55
    mapShare challenge 13 40
    Ever notice how you can't use a new drive in Windows without having Windows assigning a Disk Signature?  Ever have a signature collision problem (especially with Virtual Machines?)  This article is intended to help you understand what's going on and…
    I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
    This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now