Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I often want to copy all the file names with full path and extensions in a folder to a ".txt" document but can't. Is there an easy way to do this? How? Is there a simple batch file that will do it? Freeware might work, but I would rather have a simple batch.bat or .exe file that works.

share|improve this question
  1. Open up a command prompt

  2. Navigate to the directory you want with cd "Documents"

  3. dir /B > filelist.txt

  4. Open filelist.txt or move it where you want.

My output:

C:\Users\Tom\Documents>dir /B
Disc Images
Network Monitor 3
Scanned Documents
SQL Server Management Studio
Virtual Machines
Visual Studio 2010

You can limit to just files with dir /B /A-D. /AD meaning only directories, /A-D means not directories.

share|improve this answer

Which version of Windows? In Windows 7 at least (ought to work in Win8 as well), you can select the files, press Shift and right-click. Now you'll see a new Copy as path option that you can click on, and then paste the paths in Notepad.

share|improve this answer
thats just a lot easier than @tom and yeas works in win 8.1 – Jon Jul 28 '14 at 14:21
Great solution works on windows7 tooo. Save my lots of time – MaxPayne Aug 14 '15 at 6:31

Open a Notepad and type the below lines.

dir /a /b /-p /o:gen >names.txt

Save this file with .bat as extension. Move the .bat file to which folder you want to get list of file names. Double click the bat file. One file named names.txt will be created, which has list of file names.

share|improve this answer

(for %F in (*) do @echo %~dpnxF)|sort >filelist.txt will produce sorted list of files (with full paths) in current directory in file called filelist.txt. Change * to whatever directory\path pattern you wish. Be aware that it will include filelist.txt itself if you enumerate current directory so it's better to run from parent dir instead.

share|improve this answer

Download xplorer² lite, select all files in a folder and copy all the file names with full path and extensions to clipboard, notepad, Word or Excel using shortcut Alt+C or click in Edit and then Copy names. It works very nice and easy.

share|improve this answer

Select all files in folder, Shift+Right-Click, copy as path, paste to doc/excel/text/email

share|improve this answer
"copy as path" isn't a default option in Windows. You have to provide in specific detail how to add that option. This answer is incomplete. – Ramhound Feb 19 at 18:37
@Ramhound It is, actually, but it only appears if you hold Shift while right-clicking. This is actually a reasonable answer. I'm voting Looks OK. - From Review – Ben N Feb 20 at 0:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .