Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function RecycleFile(strFilePath)
- Dim objShell,objFolder,strFolder,strFile,arrTabs,strTab,intCount
- intCount = 0
- Set objShell = CreateObject("Shell.Application")
- arrTabs = Split(strFilePath,"\")
- strFile = arrTabs(UBound(arrTabs))
- For Each strTab in arrTabs
- If intCount = UBound(arrTabs) Then Exit For
- strFolder = strFolder & strTab & "\"
- intCount = intCount + 1
- Next
- Set objFolder = objShell.Namespace(strFolder)
- objFolder.ParseName(strFile).InvokeVerb("delete")
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement