ali_5
-
Total Posts
:
4
- Scores: 0
-
Reward points
:
0
- Joined: 6/4/2009
-
Status: offline
|
Detecting empty folders with WMI class Win32_dictory
Thursday, June 04, 2009 6:26 AM
( permalink)
Hello evrybody, I am new in this forum, Here is my script : ::\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ on error resume next Dim fso, f, s Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")._ ExecQuery("Select * from win32_directory where drive='YOUR_DRIVE'") Set fso = CreateObject("Scripting.FileSystemObject") wscript.echo "" i=0 for each c in objWMIService Set f = fso.GetFolder(c.name) if (f.size = 0) then wscript.echo f.datecreated & " " & f.shortpath :i=i+1 next wscript.echo "" wscript.echo "There are" & i & " empty folders" ::\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ If you have comments or suggestions you are welcome Thank you
|
|
|
|