Results 1 to 11 of 11
  1. #1
    New Lounger
    Join Date
    May 2015
    Location
    Alfreton
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Directory listings

    Any ideas please on how i can get a list of files in Windows Explorer within a folder and then easily copy and paste the list into say Excel to sort them. At present if I need to do this I can't copy the names of the files it cooies the files themselves

  2. #2
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,894
    Thanks
    420
    Thanked 1,585 Times in 1,434 Posts
    Shepherd,

    Welcome to the Lounge as a new poster!

    The easiest way is to open a command prompt then use this command:

    dir [/s] d:\path\*.* > filename.txt

    where:
    d: = drive letter, e.g. C:\
    path = folder path to the desired directory, e.g. \Users\Documents\Excel\
    *.* = file filter, e.g. *.* = all files, *.xls* = only Excel files
    filename = the name of the file that will get the listing.
    /s = also list all subdirectories of the selected folder.

    This file can then be inported into excel.

    Of course, I would be remiss if I didn't mention that this could also be done with a little VBA code in Excel!

    HTH
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  3. The Following User Says Thank You to RetiredGeek For This Useful Post:

    shepherd1 (2015-05-22)

  4. #3
    New Lounger
    Join Date
    May 2015
    Location
    Alfreton
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thanks for coming out of retirement, RetiredGeek

    Thats really helpful but I can't believe you have to the command prompt to do this

    I've modified what you've done slightly in that if I give the O/P file a .csv extension I can double click it to open it in Excel

  5. #4
    Silver Lounger RolandJS's Avatar
    Join Date
    Dec 2009
    Location
    Austin metro area TX USA
    Posts
    1,899
    Thanks
    111
    Thanked 144 Times in 141 Posts
    Creating a batchfile, making a shortcut to it, works -- it doesn't need user to open a command box; the batchfile will open a command box for the user.
    Addendum: Seeing PaulT's later batchfile, realized I need a %1 for the d:\path portion, have to utilize batchfile within an open dos-box in order to funnel into filenames.txt
    Last edited by RolandJS; 2015-05-23 at 14:18.
    "Take care of thy backups and thy restores shall take care of thee." Ben Franklin revisited.
    http://collegecafe.fr.yuku.com/forum...-Technologies/
    Backup, backup, backup! -- Lady Fitzgerald (sevenforums)
    Clone or Image often! Backup, backup, backup, backup... -- RockE (Windows Secrets Lounge)

  6. #5
    5 Star Lounger
    Join Date
    Jan 2010
    Location
    Fort McMurray, Alberta, Canada
    Posts
    715
    Thanks
    73
    Thanked 92 Times in 87 Posts
    This is one of those tasks that has never quite been overtaken by the GUI. The DOS method works well enough.

    One thing, for this purpose the command switch /B is often used. It gets rid of a lot of extra detail that isn't usually helpful. Thus the command pattern becomes:

    dir /s /b d:\path\*.* > filename.txt

  7. #6
    Silver Lounger
    Join Date
    Mar 2014
    Location
    Forever West
    Posts
    2,156
    Thanks
    0
    Thanked 268 Times in 257 Posts
    An alternative is Karen's Directory Printer [Karenware], has a lot of choices that can be selected/deselected. It works on Win7 and Win10TP, can send to printer or save as a .txt file.
    http://www.majorgeeks.com/files/deta...y_printer.html

  8. The Following User Says Thank You to Berton For This Useful Post:

    lumpy95 (2015-05-22)

  9. #7
    WS Lounge VIP
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    8,947
    Thanks
    61
    Thanked 1,104 Times in 1,027 Posts
    dir /s /b d:\path\*.* > filename.csv & start "" filename.csv

    cheers, Paul

  10. The Following User Says Thank You to Paul T For This Useful Post:

    access-mdb (2015-05-23)

  11. #8
    WS Lounge VIP access-mdb's Avatar
    Join Date
    Dec 2009
    Location
    Oxfordshire, UK
    Posts
    2,013
    Thanks
    164
    Thanked 192 Times in 185 Posts
    Just what I wanted Paul, thanks

  12. #9
    Silver Lounger RolandJS's Avatar
    Join Date
    Dec 2009
    Location
    Austin metro area TX USA
    Posts
    1,899
    Thanks
    111
    Thanked 144 Times in 141 Posts
    Couldn't get csv loading properly with LibreOffice, so I converted batchfile from csv to txt
    "Take care of thy backups and thy restores shall take care of thee." Ben Franklin revisited.
    http://collegecafe.fr.yuku.com/forum...-Technologies/
    Backup, backup, backup! -- Lady Fitzgerald (sevenforums)
    Clone or Image often! Backup, backup, backup, backup... -- RockE (Windows Secrets Lounge)

  13. #10
    WS Lounge VIP
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    8,947
    Thanks
    61
    Thanked 1,104 Times in 1,027 Posts
    LibreOffice reads my CSV files. What problems did you have?

    cheers, Paul

  14. #11
    5 Star Lounger Lugh's Avatar
    Join Date
    Jun 2010
    Location
    Indy
    Posts
    828
    Thanks
    209
    Thanked 106 Times in 93 Posts
    Quote Originally Posted by shepherd1 View Post
    I can't believe you have to the command prompt to do this
    Windows usually includes the basics for casual users, anything more is for the community to develop.

    There are lots of free and paid replacements for Windows Explorer out there, which may do what you want--I know the one I use does. A search will land you in File Manager heaven.

Tags for this Thread

Posting Permissions

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