I'm trying to add to a script that is deleting files on drives that are under 3 GB of free space. Overall the script works fine, except I can't get it to delete the contents of the recycle bin. Here is what I've tried:
strdrive = "c:"
wscript.echo strComputer & " Checking Recycle Bin"
strdrive = (Left(strdrive,1))
'ResFile.writeline vbtab & vbtab & strdrive & " Checking Recycle Bin"
sDirectoryPath = "\\" & strComputer & "\" & strdrive & "$\RECYCLER"
IF fs.folderexists(sDirectoryPath) then
sDirectoryPath = "\\" & strComputer & "\" & strdrive & "$\$Recycle.Bin"
'on error resume next
Set FSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = fso.GetFolder(sDirectorypath)
For Each objFile in objFolder.Files
This script runs and does not generate any errors, but it doesn't delete anything. Any help would be appreciated. Thank you.