#112130 - 2004-01-20 11:05 PM
Recycle bin sample script
|
rvdmast
Fresh Scripter
Registered: 2003-07-01
Posts: 15
|
; Recycle bin sample script uses a COM object to work ; with the recycle bin. ; Requires BinManager.dll to be installed on the system, ; see http://www.cheztabor.com/binmanager/
Dim $bin, $items, $size
$bin = CreateObject("BinManager.RecycleBin") $items = $bin.NumItems $size = $bin.Size
? "RecycleBin contains " $items " items " $size " bytes" ; Permanently delete items recycled more than two days ago. ; Note, the argument is full calendar days, so specifying ; zero would delete all items older than today. $Returnvalue = $bin.DeleteOldItems(2) ; This permanently deletes all recycled items. $Returnvalue = $bin.Empty()
|
Top
|
|
|
|
#112133 - 2004-01-21 12:11 AM
Re: Recycle bin sample script
|
rvdmast
Fresh Scripter
Registered: 2003-07-01
Posts: 15
|
Really? dont recall reading about the recycle bin in the KiX doc's. Could you give an example? I'm not too good at WMI either...
|
Top
|
|
|
|
#112134 - 2004-01-21 12:13 AM
Re: Recycle bin sample script
|
rvdmast
Fresh Scripter
Registered: 2003-07-01
Posts: 15
|
btw what has Lonkero's link have to do with this?
|
Top
|
|
|
|
#112136 - 2004-01-21 09:45 PM
Re: Recycle bin sample script
|
rvdmast
Fresh Scripter
Registered: 2003-07-01
Posts: 15
|
Quote:
However, two file sneed to preserved, namely 'desktop.ini' and the catalog file 'INFO2'.
Wich exactly why i didnt want to simply delete all files in the recycler folder, thereby possibly corrupting the recycle bin's functionality. Plus, i'd have to check for and delete the files on each logical drive. But thx for that little script sample, i'll look into that. As said i'm not much into WMI scripts (yet)
|
Top
|
|
|
|
#112142 - 2006-02-16 06:57 PM
Re: Recycle bin sample script
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
or this... I can't remember if kix support "InvokeVerb"
Option Explicit Dim oWinShell, oSHFolder, oSHFItems, oSHFItem Dim Start msgbox "Go..." start = csng(timer) Set oWinShell = CreateObject("Shell.Application") Set oSHFolder = oWinShell.Namespace("C:\")
Set oSHFItems = oSHFolder.Items Set oSHFItem = oSHFItems.Item("temp.txt") oSHFItem.InvokeVerb("&Delete")
Set oWinShell = Nothing Set oSHFolder = Nothing Set oSHFItems = Nothing Set oSHFItem = Nothing msgbox csng(timer) - start
--
|
Top
|
|
|
|
#112143 - 2006-02-16 06:58 PM
Re: Recycle bin sample script
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11622
Loc: CA
|
Not directly with KiXtart but maybe a shell to VB script which then shells the API call.
I'm sure Ruud could implement something which is the point of recent discussion I suppose, unless Masken is wanting something a bit sooner in which case that may be a great link for him Les.
Why does the Recycle Bin have different file system names on FAT and NTFS? http://blogs.msdn.com/oldnewthing/archive/2006/01/31/520225.aspx
Don't forget that KiXtart would also need to be aware of such programs as Norton Protected Recycle Bin and act accordingly.
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
1 registered
(Allen)
and 438 anonymous users online.
|
|
|