Wednesday, January 23, 2008

List of Files

List of files in a folder

On Windows OS, to get a list of names of files in a folder on my local drive, I can do -

Open a command prompt: run -> cmd
Navigate to the folder by giving the path in quotes:
cd "My Documents\myfolder"
Type command: dir > file_name.txt

This saves detailed summary of the files in the folder in text file called file_name. Details include -
Modified Date and Time,
Size,
Name of the file (with extension as .doc, .xls etc)
Total number of files in the folder

This command however, does not work on Network Drives.

EDIT - Thanks to Kirubakaran, I know a shortcut: Using "dir /b > file_name.txt", I can get just the list of file names.


List of files in an archive

A similar report can be generated to obtain list of files in an archive (.zip, .rar).

Open the archive -> ALT+G or (Go To TOOLS -> Generate Report)

I can set the parameters here to print only the File names and the Total Information. I prefer to save the information as .txt instead of HTML (uncheck the option - Use HTML format)

1 comment:

Kirubakaran A said...

You can use dir /b if you want just the file names without all other info. dir /? should list all other options.