Windows file listing to text

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.

Press «Win-E» to open Windows Explorer and locate the folder for which you need a file list.

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.

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.»

Open Microsoft Excel and press «Ctrl-O» to bring up the Open dialog window.

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.

Click «Finish» in the Text Import Wizard window to use the default options and import the directory list into Excel.

Copy list of files from Windows explorer as text into an application.

Will windows ever add a menu item or something, to copy list of files from Windows explorer as text into an application ? I would run a DOS command (dir /s c: >c-example.txt) like I have done years ago, but as I’m sure your aware, MS DOS command line has’nt been availible for years and your Windows Virtualization is incompatible with my new computer. Any solutions would be grately appreciated.

Читайте также:  Как убрать игровой режим windows 10

Have I got good news for you:

There are a couple of ways to do what you want:

The first is the most straightforward, and is already in Windows 7 (and Vista for that matter):

1. Highlight one or more files for which you’d like to know the path in Explorer.
2. Hold down the shift key, and right-click any of the highlighted files.
3. When the context menu pops up, left click on the Copy As Path entry that has magically appeared because you’re holding the shift key down.

A slightly better method, IMO, though it takes a little extra work is to add an extension to the Send To menu to allow you to right-click on a file or files and choose Send To -> Clipboard (as Name). To me this somehow seems more convenient, as I got used to the PowerToys way back when. One such extension, that also adds a nice control panel applet to help you manage the Send To menu, is a neat little freeware package called Send To Toys, by Gabriele Ponti, which can be downloaded from here:

A nice feature of the Send To Toys program is that you can even have it put quotes around any file path that contains blanks. Handy indeed!

Windows Explorer file listing to text output

Replies (2) 

1. Which application are you using to play the audio file?

The information which is on the audio file is displayed in Windows Explorer. You may copy the audio file and paste it in your desired location so that all the details associated with the audio file will also move to the new location.

You may refer to these articles and check if this helps.

Let us know if you need further help with any windows issue. We will be glad to help.

Was this reply helpful?

Sorry this didn’t help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

Читайте также:  Установка файла hosts windows

How satisfied are you with this reply?

Thanks for your feedback.

Thank you for the reply, but it is not the answer for my problem. I don’t think the media player matters, but in this case it is iTunes. All of my music will not be in iTunes at any given time as some are mine, some are my wifes, some are my kids.

I am storing a copy of all of our music on the server so we don’t loose any. I would like to get a complete database of all of the music so we know what we have and do not duplicate any. Getting the title is easy, but I would also like a lot of the metadata so I can sort by different criteria at different times. The metadata generally contains things like Artist, Album, Genre, Disk X of Y, Disk No., Composer, Size, Time, Track, Year, etc.

Thanks to anyone who can help.

Was this reply helpful?

Sorry this didn’t help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How to copy a list of file names to text file?

How can I copy the names of files in a directory to a text file or to a clipboard?

6 Answers 6

It’s very, very easy in the Windows Command-Line Interpreter (all Windows OSes):

  1. Open a command prompt (Start -> Run -> cmd Enter )
  2. Navigate ( cd ) to the directory whose files you want to list.
  3. Enter dir >output_file_name (e.g., dir > C:\dir.txt ) and press Enter .

Open the newly created text file ( C:\dir.txt ) and you’ll have the complete output of the dir command in that directory.

The greater than symbol ( > ) signifies output redirection; it sends the output from most commands to a file you specify and is very handy for being able to log output from commands.

The output can be controlled with all the various options available for customizing the normal output of the DIR command; just add the output redirection at the end of whatever arguments you want to send that output to the text file.

Update: Creating a right-click context menu for creating directory contents listing

Create a batch file and save it as %windir%\DirList.bat :

Читайте также:  Обновление приостановлено windows 10

Open your SendTo directory:

Windows 7/Vista: %appdata%\Microsoft\Windows\SendTo
Windows XP: %USERPROFILE%\SendTo

Create a new shortcut pointing to DirList.bat and call it whatever you please.

Now, right clicking on any directory and selecting the SendTo sub-menu will present your new command for listing directory contents.

NOTE: This will only work when right-clicking on a directory, and it will only list the contents of the directory you right-clicked on. It also saves the list to that directory (to avoid overwriting other files). The script could be easily modified to change where the output list file is stored.

Command to list all files in a folder as well as sub-folders in windows

I tried searching for a command that could list all the file in a directory as well as subfolders using a command prompt command. I have read the help for «dir» command but coudn’t find what I was looking for. Please help me what command could get this.

6 Answers 6

The below post gives the solution for your scenario.

/S Displays files in specified directory and all subdirectories.

/B Uses bare format (no heading information or summary).

/O List by files in sorted order.

If you want to list folders and files like graphical directory tree, you should use tree command.

There are various options for display format or ordering.

Check example output.

Answering late. Hope it help someone.

An addition to the answer: when you do not want to list the folders, only the files in the subfolders, use /A-D switch like this:

An alternative to the above commands that is a little more bulletproof.

It can list all files irrespective of permissions or path length.

I have a slight issue with the use of C:\NULL which I have written about in my blog

But nevertheless it’s the most robust command I know.

If you simply need to get the basic snapshot of the files + folders. Follow these baby steps:

  • Press Windows + R
  • Press Enter
  • Type cmd
  • Press Enter
  • Type dir -s
  • Press Enter

Following commands we can use for Linux or Mac. For Windows we can use below on git bash.

List all files, first level folders, and their contents

List all first-level subdirectories and files

Оцените статью