View Single Post
  #19  
Old December 12th 09, 09:29 AM posted to microsoft.public.windowsxp.perform_maintain
Richard[_12_]
external usenet poster
 
Posts: 429
Default Handle leak in System process?

"Charles Lavin" wrote in message
...

As for 0-length files: I just discovered that there's no way to search
for them in Windows XP ...


Hi Charles,

Here is a simple VBScript to list Zero Byte files:

'[Begin Code:]
For Each obj in GetObject("winmgmts:\\.\root\cimv2").ExecQuery(_
"Select * from CIM_DataFile where FileSize = 0")
Wscript.Echo obj.FileSize & " -- " & obj.Name
Next
'[:End Code]

Copy and paste the code into NotePad and SaveAs: C:\ZeroByte.vbs

Open a Command Prompt window (Start|Run CMD) at C:\
Use this command to list files:
Cscript ZeroByte.vbs | More

That will list the files one screen full at a time, with a More prompt.
Press Spacebar for next screen full.

Or you can use this command to send the list to a text file:
Cscript ZeroByte.vbs C:\ZeroByteList.txt

Do not double click the ZeroByte.vbs file, or it will run with Wscript,
(instead of Cscript,) and will use the MsgBox feature to display the files
one file per message box, one after another when you click OK. To stop
that, you have to use Task Manager to End this Process: Wscript.exe

Keep in mind that some Zero Byte files are necessary, like those in your
"Send To" folder, and some in the root (C folder. Most Zero Byte files
are found in your "Temporary Internet Files" (TIF) subfolders, and can be
safely deleted. The normal "Internet Options" Delete Files function only
gets rid of files that are listed in the [TIF] index.dat file. There are
other programs beside Internet Explorer that use TIF for temp files.

HTH (Hope This Helps.
--Richard



Ads