Share via

find all excel workbooks on computer

Anonymous
2021-11-12T23:05:24+00:00

Hello,

Other than searching in windows explorer for .xl how can I find all excel workbooks on my computer?

I would like to save the results to a workbook with location and filename. Find the workbooks that happened to settle in unexpected folders, i.e., My Pictures.

TIA

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
  1. Anonymous
    2021-11-13T00:57:05+00:00

    Hello Rene29

    Hi, I'm Karl and will be happy to help you today.

    The way you can accomplish the above would be to use the <Command Line> DIR command starting from the root of the drive you want to search - i,e if you have multiple drives, you would need to search each drive separately

    To do this, launch the <Command Prompt> by entering <Cmd> (or <Command Prompt>) (without the brackets in the Windows <search> box and then enter

    #1 - dir c: (or whatever drive you want to search)

    #2 - dir *.xlsx /s /b >fldrlist.txt

    a) complete info on the DIR command can be found in

    dir

    https://docs.microsoft.com/en-us/windows-server...

    b) the >fldrlist.txt is any file name you choose to save the results in - it can be any name you choose and will be created in the directory from which you started the DIR command

    c) wildcard char don't work for the extension (i.e. *.xl*) so you would need to do a separate DIR command for each desired extension.

    #3 - Once you have created the output file, just a matter of opening it in Excel but note, the results will be in one column, the folder path and file name are not separated

    20+ people found this answer helpful.
    0 comments No comments

5 additional answers

Sort by: Most helpful
  1. Anonymous
    2021-11-13T15:53:27+00:00

    Hello,

    Your first response was my solution. I was able to select all and paste the results without a text editor.

    Steps I used for tree |clip.

    Select the folder or drive, Open Command window, type tree |clip, press enter, select a cell in Excel, Ctrl +V. Pastes as I expect.

    Steps I used for dir *.xlsm /s /b <fldrlist.txt

    Command window, type dir *.xlsm /s /b <fldrlist.txt, press enter, left click small black box in upper left corner of window, select edit, select all, select left click small black box again, select copy, paste in excel using Ctrl +V

    Thank you again

    2 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2021-11-13T03:36:01+00:00

    I typed > instead of <

    The return looks as expected but will not paste, my error, I'm sure. I've used tree |clip for folder hierarchy and it pastes in excel without issues. I don't see a difference.

    Thanks for your patience

    1 person found this answer helpful.
    0 comments No comments
  3. Anonymous
    2021-11-13T02:00:51+00:00

    Not quite clear what the question is

    #1 - Did you actually invoke the <dir *.xlsm /s /b >fldrlist.txt> from within the <Command Prompt>? (as shown in the attached screenshot - in this example, am running it from the root of E:\ drive

    #2 - If you did, it would have created a file called in the location from which you ran the DIR command - at least that's what it does for me. Tested this before posting my previous response

    #3 - Am not at all clear what you are doing re:

    >>

    Paste in excel or notepad and it pastes

    dir *.xlsx /s /b >fldrlist.txt

    <<

    You don't paste that line in either NotePad or Excel. You open the <Fldrlist.txt> file like you would any other text file. This file would look like the 2nd part of the screenshot

    1 person found this answer helpful.
    0 comments No comments
  4. Anonymous
    2021-11-13T01:44:20+00:00

    Hello,

    Don't know if it is spacing or something else.

    Type Z:

    dir *.xlsm /s /b >fldrlist.txt

    Paste in excel or notepad and it pastes

    dir *.xlsx /s /b >fldrlist.txt

    I did not type .xlsx

    1 person found this answer helpful.
    0 comments No comments