Use DIR Command To Generate List Of Files And Store It In File

DIR /S /B /A:-D
I use simple DIR command to generate file lists. It serves me in many scenarios. For example, I use it to generate .Net assemblies list when I conduct preliminary scan as part of code inspection process. Here are the explanations to the switches:
  • /S - search sub folders
  • /B - bare format, no summaries and headings
  • /A:-D - no directories, files only

To save generated list of files into text file simply add >C:\myfileslist.txt. The resulting command would look as follows:

DIR /S /B /A:-D *.DLL >C:\myfileslist.txt

My related posts:

Published 01 December 07 02:16 by alikl

Comments

# JasonHuff said on December 6, 2007 12:21 PM:

Here's a reghack to add this ListFolder option to your Explorer. Copy and save as a .reg file or add it manually.  Works on XP or Vista.  Change the Dir options as needed....enjoy.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Folder\shell\ListFolder\Command]

@="cmd.exe /c dir /a/ogen/-p \"%1\">c:\\dir.txt & notepad.exe c:\\dir.txt &"

# alikl said on December 6, 2007 3:17 PM:

Jason! This is super cool!!

Thanks

New Comments to this post are disabled

Search

This Blog

. My Personal Blog .

.Net Performance How To's

.Net Security How To's

Design Patterns

Impactful

Lifecycle Phases

Popular

Tools

Syndication

Page view tracker