set ObjShell = createobject("wscript.shell")
On Error Resume Next
set rbobj = CreateObject("AXRecycle.Recycle")
If Err.Number <> 0 Then
' ObjShell.popup "AXRecycle.DLL is not registered.",2
Err.Clear
Set oFSO = CreateObject("Scripting.FileSystemObject")
strCurDir = left
(WScript.ScriptFullName,instrrev(WScript.ScriptFullName,"\"))
strDLLFile = strCurDir & "AXRecycle.dll"
If oFSO.FileExists(strDLLFile) Then
' ObjShell.popup "Found DLL in current dir. Auto-registering.",2
ObjShell.Run "regsvr32 /s " & strDLLFile,0,true
set rbobj = CreateObject("AXRecycle.Recycle")
' ObjShell.popup "Emptying Recycle Bin.",2
rbobj.EmptyRecycleNOC()
Else
wscript.echo "AXRecycle.DLL is not registered." & vbNewLine & _
"Could not find AXRecycle.dll to auto-register it. " & _
vbNewLine & " Aborting."
wscript.quit (2)
End if
'wscript.quit(5)
Else
' ObjShell.popup "AXRecycleBin.DLL is registered (good).",2
'Continue on
rbobj.EmptyRecycleNOC()
End If
-----------------------------------------------------------
Sometimes I'll stand on top of my apartment
balcony railing, close my eyes, tilt my head
skyward, stretch my arms out and think to myself,
"This always ends badly. Why do I keep doing this?"
-----------------------------------------------------------
Thanks for coding this little gem of a DLL, Lee!
Curtis
AKA "Ned"
"Ned Flanders" <ned...@hotmail.com> wrote in message
news:OV80nebXCHA.1688@tkmsftngp10...
<SNIP original post>
See my post on the PrinterObject ActiveX dll
Lee