我的 vb 宏监视文件夹路径以创建新文件。我可以监视本地驱动器中的路径。如何提供网络驱动器的路径???
下面是我的代码。这里 strDirToMonitor 是我需要提供网络路径(\share\files)的地方
但是 \ 不工作..
strComputer = "."
strDirToMonitor = "c:\\\\test"
'// Monitor Above every 10 secs...
strTime = "10"
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colMonitoredEvents = objWMIService.ExecNotificationQuery _
("SELECT * FROM __InstanceOperationEvent WITHIN " & strTime & " WHERE " _
& "Targetinstance ISA 'CIM_DirectoryContainsFile' and " _
& "TargetInstance.GroupComponent= " _
& "'Win32_Directory.Name=" & Chr(34) & strDirToMonitor & Chr(34) & "'")