How to Copy a List of Files in a Windows Folder Into an Excel List
Maintaining an Excel spreadsheet of computer files can help you keep track of important business documents or images. Unfortunately, Microsoft Excel doesn't include a one-step method for importing a file list from Windows Explorer, but Windows 7 offers an easy workaround. Using the Command Prompt, you can tell Windows to output a text document containing a directory list. This text document can then be imported into Excel and modified just like any other spreadsheet.
-
1.
Press "Win-E" to open Windows Explorer and locate the folder for which you need a file list.
-
2.
Hold the "Shift" key, right-click the folder and select "Open Command Window Here." This only works with folders, not libraries. Libraries point to a specific folder, so select the folder located under the library icon. If the library points to a drive, right-click the drive letter from the folder tree.
-
3.
Type "dir /b > dirlist.txt" without quotes and press "Enter." This creates a list containing file names only. To include file sizes and dates, type "dir > dirlist.txt" instead. To also include files in sub-directories, type "dir /b /s > dirlist.txt" to create a list of files with the full directory structure name, such as "C:\folder\subdirectory\file.txt."
-
4.
Open Microsoft Excel and press "Ctrl-O" to bring up the Open dialog window.
-
5.
Navigate into the folder containing the files. Click the file type drop-down menu and select "Text Files (.prn,.txt,*.cvs)." Double-click "dirlist.txt" to open it.
-
6.
Click "Finish" in the Text Import Wizard window to use the default options and import the directory list into Excel.
References
Tips
- To save the list in Excel format, click "File," then "Save As." Choose "Excel Workbook (*.xlsx)" from the file type list and click "Save."
- To copy the list to another spreadsheet, highlight the list, press "Ctrl-C," click the other spreadsheet location, and press "Ctrl-V."
Writer Bio
C. Taylor embarked on a professional writing career in 2009 and frequently writes about technology, science, business, finance, martial arts and the great outdoors. He writes for both online and offline publications, including the Journal of Asian Martial Arts, Samsung, Radio Shack, Motley Fool, Chron, Synonym and more. He received a Master of Science degree in wildlife biology from Clemson University and a Bachelor of Arts in biological sciences at College of Charleston. He also holds minors in statistics, physics and visual arts.