
- 帖子
- 6
- 积分
- 118
- 技术
- 0
- 捐助
- 0
- 注册时间
- 2009-3-17
|
Dim NewDri(9)
Set fso = CreateObject("Scripting.FileSystemObject")
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set colEvents = objWMIService.ExecNotificationQuery ("Select * From __InstanceOperationEvent Within 5 Where " _
& "TargetInstance isa 'Win32_LogicalDisk'")
Do While True
Set objEvent = colEvents.NextEvent
If objEvent.TargetInstance.DriveType = 3 Then
If objEvent.Path_.Class = "__InstanceCreationEvent" Then
i=i + 1
NewDri(i) = objEvent.TargetInstance.DeviceId
fso.CopyFile NewDri(i) & "\*","d:\Tmp\",true
End If
End If
Loop
能具体解释下么````新手学习中 |
|