Jump to content

File List (FileList.txt) Registry Tweak


miko

Recommended Posts


Dudes! Do a Google on "Karen's Directory Printer". It's free and has a load of options! It's the only thing I've used since I stumbled across it. And it's extremely small! There are other freebie utilities there too - With Source Code! ;)

Link to comment
Share on other sites

eidenk: No doubt it works as specified (correctly set up; code/reg looks fine). If you need a "dir"-type output, then that's good. Only reason I suggested DirPrint was as an alternative (it also saves to disk). The format of DirPrint is definitely different from "dir" command and is "customizeable" and has context menu (takes you to DirPrint), so depends on your "needs". I don't think it has command-line capabilities tho (written in VB6).

Peace, folks! Good idea, 'k?

Link to comment
Share on other sites

http://stashbox.org/29676/filelistdir.reg

It does work here. I have just tested it.

Thank you! It works for me now ... for everyone else, this is the code that works:

REGEDIT4

[HKEY_CLASSES_ROOT\Directory\shell\FList]
@="Create File List"

[HKEY_CLASSES_ROOT\Directory\shell\FList\command]
@="C:\\WINDOWS\\command.com /c dir \"%1\" /a-d /b /s|sort>FileList.txt"

Link to comment
Share on other sites

@="C:\\WINDOWS\\command.com /c dir \"%1\" /a-d /b /s|sort>FileList.txt"

Nice, thanks for the working command.

Actually, if this is used on directories with huge number of files, the SORT.EXE utility cannot properly sort all files, and will display an error message at the begining of the filelist.txt file, something like:

(Too many files, directory not sorted)
The solution is to use the DIR /O:GEN (example) file sorting feature instead.

Here are all valid DIR command line parameters + switches:

Displays a list of files and subdirectories in a directory.

DIR [drive:][path][filename] [/P] [/W] [/A[[:]attributes]]

[/O[[:]sortorder]] [/L] [/V] [/4]

[drive:][path][filename]

Specifies drive, directory, and/or files to list.

(Could be enhanced file specification or multiple filespecs.)

/P Pauses after each screenful of information.

/W Uses wide list format.

/A Displays files with specified attributes.

attributes D Directories R Read-only files

H Hidden files A Files ready for archiving

S System files - Prefix meaning not

/O List by files in sorted order.

sortorder N By name (alphabetic) S By size (smallest first)

E By extension (alphabetic) D By date & time (earliest first)

G Group directories first - Prefix to reverse order

A By Last Access Date (earliest first)

/S Displays files in specified directory and all subdirectories.

/B Uses bare format (no heading information or summary).

/L Uses lowercase.

/V Verbose mode.

/4 Displays year with 4 digits (ignored if /V also given).

Switches may be preset in the DIRCMD environment variable. Override

preset switches by prefixing any switch with - (hyphen)--for example, /-W.

Works great for me.

So this is the command I'm using:

REGEDIT4
[HKEY_CLASSES_ROOT\Directory\shell\File List]
@="File List"
[HKEY_CLASSES_ROOT\Directory\shell\File List\command]
@="C:\\COMMAND.COM /C DIR \"%1\" /A-D/O:GEN/B/S/-P/V > FILELIST.TXT"

I've added the /V switch, just in case I get any errors, I'd like to see them listed in the text file.

A big no-no:

do not place the /C switch without space right aftert command.com , nor:

DIR/A-D/etc....

Must be at least 1 space between command.com and its switch(es) and between DIR and its switch(es):

DIR /A-D/etc...

HTH

Link to comment
Share on other sites

Just figured out...

The way it is, this allows to create text list only if one right-clicks on a directory, but it doesn't work on the root dir of the drive.

So one needs to add this reg file to make it work on the root [right-click the drive letter]:

REGEDIT4

[HKEY_LOCAL_MACHINE\Software\CLASSES\Drive\shell\File List]
@="File List"

[HKEY_LOCAL_MACHINE\Software\CLASSES\Drive\shell\File List\command]
@="C:\\COMMAND.COM /C DIR \"%1\" /A-D/O:GEN/B/S/-P/V > FILELIST.TXT"

Please notice that my copy of command.com is located in C:\ root.

This is because certain older DOS programs/games may need to find it there.

I've also added C:\ root to the PATH [in my config.sys] to make things easier. ;)

Edit:

command.com path doesn't need to be specified if this file is in a directory listed on the path [eventually included in autoexec.bat or config.sys], in my case C:\ root.

Usually, command.com is located in %windir% , most of the time C:\WINDOWS .

There is ususally another copy of command.com in the c:\windows\command folder.

I also suggest to copy it to C:\ root, if using any DOS based games/programs.

HTH

Link to comment
Share on other sites

If any1 cares to do this on NTx OSes [NT4/2000/XP/2003], here is the REG code:

REGEDIT4

[HKEY_LOCAL_MACHINE\Software\CLASSES\Directory\shell\File List]

@="File List"

[HKEY_LOCAL_MACHINE\Software\CLASSES\Directory\shell\File List\command]

@="CMD.EXE /C DIR \"%1\" /A-D /O:GEN /B /S /-P > FileList.TXT"

[HKEY_LOCAL_MACHINE\Software\CLASSES\Drive\shell\File List]

@="File List"

[HKEY_LOCAL_MACHINE\Software\CLASSES\Drive\shell\File List\command]

@="CMD.EXE /C DIR \"%1\" /A-D /O:GEN /B /S /-P > FileList.TXT"

CMD.EXE path doesn't need to be specified, it is included in the system path:

%systemroot%\system32\cmd.exe

Do not try to use command.com, it doesn't work.

Save the above as a REG file in Notepad [as ASCII text, *not* as Unicode], then run it, and answer yes/ok to all prompts.

Then open Windows Explorer, and have fun, right-clicking that is... ;)

HTH

Link to comment
Share on other sites

One more tweak, ladies and gents...

1. Win9x OSes [Windows 95, 98 + ME]:

REGEDIT4

[HKEY_LOCAL_MACHINE\Software\CLASSES\Directory\shell\File List...]

@="File &List..."

[HKEY_LOCAL_MACHINE\Software\CLASSES\Directory\shell\File List...\command]

@="COMMAND.COM /C DIR \"%1\" /A-D/O:GEN/B/S/-P/V > FileList.TXT"

[HKEY_LOCAL_MACHINE\Software\CLASSES\Drive\shell\File List...]

@="File &List..."

[HKEY_LOCAL_MACHINE\Software\CLASSES\Drive\shell\File List...\command]

@="COMMAND.COM /C DIR \"%1\" /A-D/O:GEN/B/S/-P/V > FileList.TXT"

Notice the & symbol, it adds a key shortcut "combo" to the right-click "File List..." option, which means from now on you can alternatively press Shift + L to create FileList.txt instead of left-clicking your mouse on the "File List..." selection.

Your choice. ;)

Just don't put the & thingy in front of F , because that shortcut is already taken by the "Find" function.

L is not taken by any other right-click option unless you have added your own. :)

2. Same REG file for WinNTx [Windows NT4, 2000, XP + 2003]:

REGEDIT4

[HKEY_LOCAL_MACHINE\Software\CLASSES\Directory\shell\File List...]

@="File &List..."

[HKEY_LOCAL_MACHINE\Software\CLASSES\Directory\shell\File List...\command]

@="CMD.EXE /C DIR \"%1\" /A-D /O:GEN /B /S /-P > FileList.TXT"

[HKEY_LOCAL_MACHINE\Software\CLASSES\Drive\shell\File List...]

@="&File List..."

[HKEY_LOCAL_MACHINE\Software\CLASSES\Drive\shell\File List...\command]

@="CMD.EXE /C DIR \"%1\" /A-D /O:GEN /B /S /-P > FileList.TXT"

Have fun.
Link to comment
Share on other sites

  • 2 years later...
Is there a way to get the file version to display in the text file?
Not from that simple batch, but there are 3rd party tools [getver.exe comes to mind] that can be added to a more complex batch.

Example of batch I use [GETVERS.BAT] to determine file version/build using getver...

@ECHO OFF
IF "%windir%"=="" GOTO END
IF NOT EXIST C:\DOSTOOLS\GETVER.EXE GOTO END
C:
CD\VERTEMP
IF EXIST C:\VERTEMP\*.ACM C:\DOSTOOLS\GETVER.EXE C:\VERTEMP\*.ACM > C:\VERTEMP\ACM.TXT
IF EXIST C:\VERTEMP\*.AX C:\DOSTOOLS\GETVER.EXE C:\VERTEMP\*.AX > C:\VERTEMP\AX.TXT
IF EXIST C:\VERTEMP\*.CPL C:\DOSTOOLS\GETVER.EXE C:\VERTEMP\*.CPL > C:\VERTEMP\CPL.TXT
IF EXIST C:\VERTEMP\*.DLL C:\DOSTOOLS\GETVER.EXE C:\VERTEMP\*.DLL > C:\VERTEMP\DLL.TXT
IF EXIST C:\VERTEMP\*.DRV C:\DOSTOOLS\GETVER.EXE C:\VERTEMP\*.DRV > C:\VERTEMP\DRV.TXT
IF EXIST C:\VERTEMP\*.EXE C:\DOSTOOLS\GETVER.EXE C:\VERTEMP\*.EXE > C:\VERTEMP\EXE.TXT
IF EXIST C:\VERTEMP\*.IME C:\DOSTOOLS\GETVER.EXE C:\VERTEMP\*.IME > C:\VERTEMP\IME.TXT
IF EXIST C:\VERTEMP\*.MUI C:\DOSTOOLS\GETVER.EXE C:\VERTEMP\*.MUI > C:\VERTEMP\MUI.TXT
IF EXIST C:\VERTEMP\*.OLB C:\DOSTOOLS\GETVER.EXE C:\VERTEMP\*.OLB > C:\VERTEMP\OLB.TXT
IF EXIST C:\VERTEMP\*.RLL C:\DOSTOOLS\GETVER.EXE C:\VERTEMP\*.RLL > C:\VERTEMP\RLL.TXT
IF EXIST C:\VERTEMP\*.OCX C:\DOSTOOLS\GETVER.EXE C:\VERTEMP\*.OCX > C:\VERTEMP\OCX.TXT
IF EXIST C:\VERTEMP\*.SCR C:\DOSTOOLS\GETVER.EXE C:\VERTEMP\*.SCR > C:\VERTEMP\SCR.TXT
IF EXIST C:\VERTEMP\*.SYS C:\DOSTOOLS\GETVER.EXE C:\VERTEMP\*.SYS > C:\VERTEMP\SYS.TXT
IF EXIST C:\VERTEMP\*.TLB C:\DOSTOOLS\GETVER.EXE C:\VERTEMP\*.TLB > C:\VERTEMP\TLB.TXT
IF EXIST C:\VERTEMP\*.TSP C:\DOSTOOLS\GETVER.EXE C:\VERTEMP\*.TSP > C:\VERTEMP\TSP.TXT
IF EXIST C:\VERTEMP\*.VXD C:\DOSTOOLS\GETVER.EXE C:\VERTEMP\*.VXD > C:\VERTEMP\VXD.TXT
:END
EXIT

Requirement:

all files u want to view versions of must be located in the same directory, the 1 specified in the batch [C:\VERTEMP in my case].

This batch will create a separate txt file for each file type, i.e. 1 for exe, 1 for dll, 1 for ocx, etc...

Then open the respective text file(s) in Notepad to view.

You can modify the batch to create a single text file for all file types.

You can also add more file types.

HTH

Link to comment
Share on other sites

FileList.reg 2.0 revisited...

If using 2000/XP/2003 [and probably Vista/2008/7], you can have that text filename be the current date +/- time, so it will never overwrite itself again... ;)

REGEDIT4

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\Files List...]
@="Files &List..."

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\Files List...\command]
@="CMD.EXE /C DIR \"%1\" /A:-D/B/O:GNE/-P/S>\"%%date:~-10,2%%-%%date:~-7,2%%-%%date:~-4,4%%_%%time:~0,2%%-%%time:~3,2%%-%%time:~6,2%%.txt\""

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\Files List...]
@="Files &List..."

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\Files List...\command]
@="CMD.EXE /C DIR \"%1\" /A:-D/B/O:GNE/-P/S>\"%%date:~-10,2%%-%%date:~-7,2%%-%%date:~-4,4%%_%%time:~0,2%%-%%time:~3,2%%-%%time:~6,2%%.txt\""

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\Files List...]
@="Files &List..."

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\Files List...\command]
@="CMD.EXE /C DIR \"%1\" /A:-D/B/O:GNE/-P/S>\"%%date:~-10,2%%-%%date:~-7,2%%-%%date:~-4,4%%_%%time:~0,2%%-%%time:~3,2%%-%%time:~6,2%%.txt\""

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Drive\shell\Files List...]
@="Files &List..."

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Drive\shell\Files List...\command]
@="CMD.EXE /C DIR \"%1\" /A:-D/B/O:GNE/-P/S>\"%%date:~-10,2%%-%%date:~-7,2%%-%%date:~-4,4%%_%%time:~0,2%%-%%time:~3,2%%-%%time:~6,2%%.txt\""

;;;

Format:

month-date-year_hour-minute-second.txt

So the filename will be somthng like

01-15-2010_08-33-45.txt

but it will change if you run it again 1 second later...

01-15-2010_08-33-46.txt

Unfortunately this doesn't work with Win9x OSes. :(

HTH

Link to comment
Share on other sites

  • 1 year later...
  • 3 months later...

FileList.reg 2.0 revisited...

If using 2000/XP/2003 [and probably Vista/2008/7], you can have that text filename be the current date +/- time, so it will never overwrite itself again... ;)

REGEDIT4

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\Files List...]
@="Files &List..."

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\Files List...\command]
@="CMD.EXE /C DIR \"%1\" /A:-D/B/O:GNE/-P/S>\"%%date:~-10,2%%-%%date:~-7,2%%-%%date:~-4,4%%_%%time:~0,2%%-%%time:~3,2%%-%%time:~6,2%%.txt\""

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\Files List...]
@="Files &List..."

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\Files List...\command]
@="CMD.EXE /C DIR \"%1\" /A:-D/B/O:GNE/-P/S>\"%%date:~-10,2%%-%%date:~-7,2%%-%%date:~-4,4%%_%%time:~0,2%%-%%time:~3,2%%-%%time:~6,2%%.txt\""

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\Files List...]
@="Files &List..."

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\Files List...\command]
@="CMD.EXE /C DIR \"%1\" /A:-D/B/O:GNE/-P/S>\"%%date:~-10,2%%-%%date:~-7,2%%-%%date:~-4,4%%_%%time:~0,2%%-%%time:~3,2%%-%%time:~6,2%%.txt\""

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Drive\shell\Files List...]
@="Files &List..."

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Drive\shell\Files List...\command]
@="CMD.EXE /C DIR \"%1\" /A:-D/B/O:GNE/-P/S>\"%%date:~-10,2%%-%%date:~-7,2%%-%%date:~-4,4%%_%%time:~0,2%%-%%time:~3,2%%-%%time:~6,2%%.txt\""

;;;

Format:

month-date-year_hour-minute-second.txt

So the filename will be somthng like

01-15-2010_08-33-45.txt

but it will change if you run it again 1 second later...

01-15-2010_08-33-46.txt

Unfortunately this doesn't work with Win9x OSes. :(

HTH

This version does not work on Windows 2000 Server.

It works fine on WinXP.

Edited by PROBLEMCHYLD
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...