Hi Paul,
I am not a cmdprompt expert but I do not think that there is a cmd prompt command
that can be used to search for files with the compressed attribute. Perhaps the
following method, posted by MVP Scripting Expert Torgeir Bakken, would meet your
needs though.
Google Groups URL to original thread:
http://www.google.com/groups?&[email protected]
----- Begin Original Message -----
From: "Torgeir Bakken (MVP)" <
[email protected]>
Newsgroups: microsoft.public.win2000.file_system
Sent: Monday, February 24, 2003 09:10 PM
Subject: Re: How can I list every file in an NTFS FS that has been compresed ?
Easy with WMI, put the script below in a .vbs file and run it in a command prompt
with cscript.exe:
sComputer = "." ' use "." for local computer
Set oWMI = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & sComputer & "\root\cimv2")
' Getting only the Name property from the files found
sWQL = "select Name from cim_datafile where Drive='c:'" _
& "AND Compressed=True"
Set oResult = oWMI.ExecQuery(sWQL,,48)
For Each oFile In oResult
WScript.Echo oFile.Name
Next
----- End Original Message -----
Note 1: This script is Memory and time intensive.
Note 2: As written the script searches the C:\ Drive. To search a different drive
replace the c in the following line with the desired drive letter: Drive='c:'"
Note 3: To redirect the output to a text file follow this example:
- Copy and paste Torgeir's script into notepad and save it as compressedfiles.vbs
- Open the command prompt (cmd.exe) to the directory where you saved
compressedfiles.vbs
- Use the following command to redirect the output to the text file named
compressed.txt:
cscript compressedfiles.vbs > compressed.txt
Note 4: If you have any questions about scripting I suggest that you post in an
appropriate newsgroup such as:
microsoft.public.win2000.cmdprompt.admin
microsoft.public.scripting.vbscript
--
Carrie Garth, Microsoft MVP for Windows 2000
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- c x g
: "Paul Smith" <Paul_Smith AT millipore DOT com>
: Wrote in message : Sent: Tuesday, October 07, 2003 07:50 AM
:
: Does anyone know of a way to search for compressed files
: via the command line? I've looked under different
: attributes but haven't found anything.