Quantcast
Viewing latest article 25
Browse Latest Browse All 43

Answer by Jeroen Wiert Pluimers for How can I search for files that are either compressed or uncompressed in Windows Explorer?

and31415 has posted a nice solution for Windows Explorer that works at least in Windows 7 and up (maybe in Vista, will check that later).

So for older Windows versions like XP and 2003, I've researched for a command-line solution that could generate a list of compressed or uncompressed files.

Compact: nice, but output is hard to parse

The first idea was using compact, which ships with Windows.

And indeed it can list files (enclose parameters in double quotes when they contain spaces):

compact [filemask] /a /s:[directoryname]

The format is easy to read for humans, but not easy to parse.

FindCompressed has a bug with long path names giving listings like this:

C:\Program Files\VMware\Infrastructure\Virtual Infrastructure Client\Help\en\DRS41\wwhelp\wwhimpl\common\htmlinit3.htmC:\Program Files\VMware\Infrastructure\Virtual Infrastructure Client\Help\en\DRS41\wwhelp\wwhimpl\common\htmlpagenav.htm...C:\Program Files\VMware\Infrastructure\Virtual Infrastructure Client\Help\en\DRS41\wwhelp\wwhimpl\common\html\imagessplash.jpgC:\Program Files\VMware\Infrastructure\Virtual Infrastructure Client\Help\en\DRS41\wwhelp\wwhimpl\common\imagestoolsbg.gif...C:\Program Files\VMware\Infrastructure\Virtual Infrastructure Client\Help\en\DRS41\wwhelp\wwhimpl\common\scriptsunidata.js

So it cuts parts of the files or directories when the names get too long.

#FindCompressed: nice, output first/last line needs to be stripped

Exodus Development wrote the command-line tool FindCompressed. Without parameters, it finds compressed files. With the -su parameter, it finds uncompressed files. Enclose [directoryname] in double quotes when it contains spaces.

FindCompressed.exe -su [directoryname]

FindCompressed has one drawback: it always starts output with this line where # is [directoryname]:

Recursive search of compact #.

and ends with a line like this:

Found # uncompressed files in # items examined. 

The lines between those contain a full path to the uncompressed or compressed filename.
That is easy to parse.


Viewing latest article 25
Browse Latest Browse All 43

Trending Articles