| |
raylor9355
Posts: 1
Score: 0
Joined: 5/9/2008
Status: offline
|
I have been trying to come up with a script that will monitor a folder and copy all the contents to multiple UNC paths or shares. this is what I have below. I just need the "copy to UNC paths part done. Any help would be appreciated. strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & _ strComputer & "\root\cimv2") Set colMonitoredEvents = objWMIService.ExecNotificationQuery _ ("SELECT * FROM __InstanceCreationEvent WITHIN 10 WHERE " _ & "Targetinstance ISA 'CIM_DirectoryContainsFile' and " _ & "TargetInstance.GroupComponent= " _ & "'Win32_Directory.Name=""c:\\\\monitor""'") Do Set objLatestEvent = colMonitoredEvents.NextEvent Wscript.Echo objLatestEvent.TargetInstance.PartComponent Loop
|
|