Hello,
I am trying to run a reycle bin cleaner if the file "binmanager.dll" exists in %systemroot\system32. The script works well without the If statement and I have verified that the file does exist. But when I run the script it acts as if the file doesn't exist. Is there anything incorrect in using the variable %systemroot% ??
code is below
thanks,
Ben
Dim fso
Dim filesys
Set filesys = CreateObject("Scripting.FileSystemObject")
If filesys.FileExists("%systemroot%\system32\binmanager.dll") Then
Set fso = CreateObject("BinManager.RecycleBin")
fso.DeleteOldItems(10)
End if
I am trying to run a reycle bin cleaner if the file "binmanager.dll" exists in %systemroot\system32. The script works well without the If statement and I have verified that the file does exist. But when I run the script it acts as if the file doesn't exist. Is there anything incorrect in using the variable %systemroot% ??
code is below
thanks,
Ben
Dim fso
Dim filesys
Set filesys = CreateObject("Scripting.FileSystemObject")
If filesys.FileExists("%systemroot%\system32\binmanager.dll") Then
Set fso = CreateObject("BinManager.RecycleBin")
fso.DeleteOldItems(10)
End if