找回密码
 加入
搜索
查看: 1994|回复: 0

[系统综合] wmi监视文件夹下文件的创建、删除,为何对ie缓存文件夹无效?

[复制链接]
发表于 2014-9-21 20:55:29 | 显示全部楼层 |阅读模式
$strComputer = "."
$objWMIService = ObjGet("winmgmts://" & $strComputer & "/root/cimv2")

$colMonitoredEvents = $objWMIService.ExecNotificationQuery _
                ("SELECT * FROM __InstanceOperationEvent WITHIN 5 WHERE " _
                 & "Targetinstance ISA 'CIM_DirectoryContainsFile' and " _
                 & "TargetInstance.GroupComponent= " _
                 & "'Win32_Directory.Name=""c:\\\\1""'");c:\\\\1  C:\\\\Users\\\\Administrator\\\\AppData\\\\Local\\\\Microsoft\\\\Windows\\\\Temporary Internet Files;对本地文件夹没问题,对ie缓存目录无效

While 1
        $objEventObject = $colMonitoredEvents.NextEvent()
        Select
                Case $objEventObject.Path_.Class() = "__InstanceCreationEvent"
                        ConsoleWrite("A new file was just created: " & $objEventObject.TargetInstance.PartComponent() & @CR)
                Case $objEventObject.Path_.Class() = "__InstanceDeletionEvent"
                        ConsoleWrite("A file was just deleted: " & $objEventObject.TargetInstance.PartComponent() & @CR)
        EndSelect
WEnd
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-11-17 10:55 , Processed in 0.151894 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表