Windows – How to copy all file names in a folder to notepad

windows

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.

Best Answer

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

Related Question