I am running the following script to delete files from a folder upon login. The script works fine, but the problem is not all users have this folder path. Is there a way to supress the path not found error? Applying script to certain GPOs is not an option.
Set objShell = CreateObject( "WScript.Shell" )
strFolder = strLocalAppData & "\Cisco\Unified Communications\Jabber\CSF\Photos"
Set fso = CreateObject("Scripting.FileSystemObject")
For Each objFile In fso.GetFolder(strFolder).Files
' Wscript.Echo "Deleting file: " & objFile.Path
For Each objSubfolder In fso.GetFolder(strFolder).Subfolders
' Wscript.Echo "Deleting folder: " & objSubfolder.Path