标题: wmi监视文件的时候,路径为什么必须要四个\\\\???
[打印本页]
作者: fzhang
时间: 2008-11-20 19:34
标题: wmi监视文件的时候,路径为什么必须要四个\\\\???
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\cimv2")
Set colMonitoredEvents = objWMIService.ExecNotificationQuery _
("SELECT * FROM __InstanceDeletionEvent WITHIN 10 WHERE " _
& "Targetinstance ISA 'CIM_DirectoryContainsFile' and " _
& "TargetInstance.GroupComponent= " _
& "'Win32_Directory.Name=""c:\\\\scripts""'")
Do
Set objLatestEvent = colMonitoredEvents.NextEvent
Wscript.Echo objLatestEvent.TargetInstance.PartComponent
Loop
这是一段微软的例子
我不理解的是为什么,路径必须是c:\\\\scripts????
为什么正常的c:\
我看好像也不是正则匹配