Grab the Names of all files in a Folder

To grab the names of all the files in a folder, start by launching a command line window at that folder. Here's how:

If you're using XP, select Start, All Programs, Accessories, Command Prompt.At the prompt, type cd and the path to the folder you want printed. In typing the path, you can abbreviate "C:\Documents and Settings\logon (where logon is the name you log on with) to %userprofile%. In other words, instead of "C:\Documents and Settings\Dave\My Documents," simply type"%userprofile%\my documents".

This is easier with Vista and Windows 7. Navigate Windows Explorer to the folder above one you want. In the right pane, hold down SHIFT as you right-click the folder you want to copy from and select Open Command Window Here.

Once you're at the right location, type dir /b > dir.txt and press ENTER. (If you want file details as well as names, skip the /b part.) This creates a text file, dir.txt, with your directory listing.

You can load a .txt file into Word or Excel. Or you can double-click it to load it into Notepad, where you can copy its contents and paste them into just about any program.