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)
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...
|
|
|
|