Are you executing the script with "run as administrator"?
Add "true" to force delete the file.
objFSO.DeleteFile objItem.Path,true
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I'm new, and I need to delete ALL the contents of the recycle bin (files and folders), but at the end of the process I receive the message: 800a0035 “file not found” or 800A004C “path not found.”
UPDATED: I SOLVED IT, I PUBLISH THE CODE
Const RECYCLE_BIN = &Ha&
Set FSO = CreateObject("Scripting.FileSystemObject")
Set ObjShell = CreateObject("Shell.Application")
Set ObjFolder = ObjShell.Namespace(RECYCLE_BIN)
Set ObjFolderItem = ObjFolder.Self
Set colItems = ObjFolder.Items
For Each objItem in colItems
If (objItem.Type = "File folder") Then
Else
FSO.DeleteFile(objItem.Path)
End If
Next
Set colItems = ObjFolder.Items
For Each objItem in colItems
If (objItem.Type = "File folder") Then
Else
FSO.DeleteFolder(objItem.Path)
End If
Next
Are you executing the script with "run as administrator"?
Add "true" to force delete the file.
objFSO.DeleteFile objItem.Path,true
The tag "small-basic" is for Technical questions about Microsoft Small Basic, the only text-based programming language and IDE built for students to learn to code
Please remove the tag "small-basic" as your question in not about Small Basic