Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Monitor and copy script

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,60024
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Monitor and copy script
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Monitor and copy script - 5/9/2008 12:28:26 AM   
  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
 
 
Post #: 1
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Monitor and copy script Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts