Easy File to Get All the File Names From a Folder in Text Form
7 Answers 7
-
Open up a command prompt
-
Navigate to the directory you want with
cd "Documents" -
dir /B > filelist.txt -
Open filelist.txt or move it where you want.
My output:
C:\Users\Tom\Documents>dir /B all.css BFBC2 Disc Images Fax Fiddler2 gegl-0.0 Network Monitor 3 Scanned Documents SQL Server Management Studio SweetScape 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.
answered Oct 20, 2012 at 13:32
Tom RitterTom Ritter
1,076 10 silver badges 22 bronze badges
5
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.
answered Oct 20, 2012 at 20:55
KaranKaran
55.1k 20 gold badges 117 silver badges 188 bronze badges
2
-
thats just a lot easier than @tom and yeas works in win 8.1
Jul 28, 2014 at 14:21
-
Great solution works on windows7 tooo. Save my lots of time
Aug 14, 2015 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.
answered Jun 2, 2015 at 9:09
SathyaSathya
71 1 silver badge 1 bronze badge
answered Sep 25, 2020 at 13:37
RyanRyan
1,369 11 gold badges 32 silver badges 62 bronze badges
Select all files in folder, Shift+Right-Click, copy as path, paste to doc/excel/text/email
DavidPostill♦
145k 75 gold badges 339 silver badges 374 bronze badges
answered Feb 19, 2016 at 17:47
3
-
"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.
Feb 19, 2016 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
Feb 20, 2016 at 0:36
(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.
answered Oct 20, 2012 at 13:42
wmzwmz
6,992 1 gold badge 19 silver badges 32 bronze badges
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.
answered Jun 5, 2015 at 13:06
Source: https://superuser.com/questions/490306/how-do-i-copy-all-file-names-in-a-folder-to-notepad
Great answer. Is it possible to cover subfolders as well I mean recursively?
Feb 5, 2019 at 15:55
NOT working for me!!! where am I wrong?
shift+rightClickin the directory and open powershell. Trying dir /B > fileList.txt gives me error thatCannot find path 'D:\b' because it does not exist.@VVBSep 24, 2020 at 8:18
@VVB
dir /b /s > filelist.txt. Or, trydir /?for the help page.Sep 25, 2020 at 13:53
@JustCurious
DIR /Bwon't work in PowerShell, you need to use Command Prompt (cmd.exe).Sep 25, 2020 at 13:54
Navigate to the folder using windows explorer. Write "cmd" in the address bar and press enter. Write the command "dir /s /b | clip" at the command prompt to list all files as filenames only and copy to the windows clipboard. Also fun "tree /f".
Apr 5 at 17:24