Empty Recycle Bin of Current User (Folder and File Removal)

Author Message
core.ebusiness

  • Total Posts : 17
  • Scores: 0
  • Reward points : 0
  • Joined: 9/20/2010
  • Location: North Jersey
  • Status: offline
Empty Recycle Bin of Current User (Folder and File Removal) Friday, October 29, 2010 7:06 AM (permalink)
0
this script empties the recycle bin of the current logged in user (folders and files alike):
Const RECYCLE_BIN = &Ha&
 Dim objShell, objFolder, objFSO, colItems
 Set objShell = CreateObject("Shell.Application")
 Set objFolder = objShell.Namespace(RECYCLE_BIN)
 Set objFSO = CreateObject("Scripting.FileSystemObject")
 Set colItems = objFolder.Items
 For Each objItem in colItems
 If (objItem.Type = "File folder") Then
 objFSO.DeleteFolder(objItem.Path)
 Else
 objFSO.DeleteFile(objItem.Path)
 End If
 Next

 
...and its gone...
;)
 
working on one that empties the bins of all users on the computer/server...
 
#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