I need to check a shared Path for Subfolder\File existence. If it exists need to check whether the LastModified Time of the shared path has exceeded more than 1 hour.
I am getting error "Path not found" for shared path, but the code works fine for Normal Directory.
Here is my code
Dim fso, folder
folder = "C:/test"
Set fso = CreateObject("Scripting.FileSystemObject")
Set folder = fso.GetFolder(folder)
If folder.Files.Count + folder.SubFolders.Count = 0 Then
WScript.Echo "Folder is Empty"
ElseIf (folder.DateLastModified > 60) Then
WScript.Echo "Exceeded 1 hour"
Else
WScript.Echo "Not Exceeded 1 hour"
End If
This code works for the path mentioned in the script, but it throws error "Path not found" for the path \\server.com\subfolder\subfolder\subfolder
.