Re: Empty Files by Miyahn
Miyahn
Mon Aug 16 20:24:03 CDT 2004
"AHartman" wrote in message news:0badnSQWrJu0y7zcRVn-sg@kconline.com
> I want to use vbscript to scan a folder and look for empty(zero byte) files.
> If found move them to a another folder and Email me of this occurance.
Only for the first point.
The following script delete zero byte files from Internet cache folder.
These zero byte files are made by Outlook Express , and left.
Dim aFolder, aFile, WS, CachePath, N
Set WS = CreateObject("WScript.Shell")
CachePath = WS.RegRead("HKCU\Software\Microsoft\Windows\" & _
"CurrentVersion\Explorer\Shell Folders\Cache") & "\Content.IE5"
N = 0
For Each aFolder In CreateObject( _
"Scripting.FileSystemObject").GetFolder(CachePath).SubFolders
For Each aFile In aFolder.Files
If aFile.Size = 0 Then aFile.Delete: N = N + 1
Next
Next
WS.Popup N & " files have been deleted from " & CachePath , 2
Set WS = Nothing
--
Miyahn (Masataka Miyashita) JPN
Microsoft MVP (Office Systems - Excel)
HQF03250@nifty.ne.jp