Detecting empty folders with WMI class Win32_dictory

Author Message
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)
0
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
 
#1

    Online Bookmarks Sharing: Share/Bookmark

    Jump to:

    Current active users

    There are 0 members and 1 guests.

    Icon Legend and Permission

    • New Messages
    • No New Messages
    • Hot Topic w/ New Messages
    • Hot Topic w/o New Messages
    • Locked w/ New Messages
    • Locked w/o New Messages
    • Read Message
    • Post New Thread
    • Reply to message
    • Post New Poll
    • Submit Vote
    • Post reward post
    • Delete my own posts
    • Delete my own threads
    • Rate post

    2000-2012 ASPPlayground.NET Forum Version 3.9