Jump to content

ryancooper

Member
  • Posts

    6
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    United States

About ryancooper

ryancooper's Achievements

0

Reputation

  1. <{POST_SNAPBACK}> I understand what you were doing. . . What i need is the same 4 folders monitored on all my computers. Reguardless of who is at the computer. ... Make sence? One script monitores 4 folders for data then returns a message when any of those folders gets changed. . . Thanks!!
  2. <{POST_SNAPBACK}> I tryed adding your input to the code and gor a error: (changed to c: for testing at home) strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & _ strComputer & "\root\cimv2") Set colMonitoredEvents = objWMIService.ExecNotificationQuery _ ("SELECT * FROM __InstanceCreationEvent WITHIN 3 WHERE " _ & "Targetinstance ISA 'CIM_DirectoryContainsFile' and " _ & "TargetInstance.GroupComponent= " _ & "'Win32_Directory.Name=""c:\\\\dsr""'") & "'Win32_Directory.Name=""c:\\\\dsr\\\\Phil""'") & "'Win32_Directory.Name=""c:\\\\dsr\\\\Ryan""'") Do Set objLatestEvent = colMonitoredEvents.NextEvent Set WshShell = Wscript.CreateObject("Wscript.Shell") WshShell.Popup "Click me Quick!",, "My Popup Dialogue box" Loop
  3. sounds like you understand what i would like to do. BUT How do i do that?
  4. Here is some of the things i have tried that did not work strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & _ strComputer & "\root\cimv2") Set colMonitoredEvents = objWMIService.ExecNotificationQuery _ ("SELECT * FROM __InstanceCreationEvent WITHIN 300 WHERE " _ & "Targetinstance ISA 'CIM_DirectoryContainsFile' and " _ & "TargetInstance.GroupComponent= " _ & "'Win32_Directory.Name=""c:\\\\dsr\Rob""'") Do Set objLatestEvent = colMonitoredEvents.NextEvent Wscript.Echo "New DSR Data Availabel for Rob please contact Phil or Ryan. . . Thank You. Have a nice day!" Set colMonitoredEvents = objWMIService.ExecNotificationQuery _ ("SELECT * FROM __InstanceCreationEvent WITHIN 300 WHERE " _ & "Targetinstance ISA 'CIM_DirectoryContainsFile' and " _ & "TargetInstance.GroupComponent= " _ & "'Win32_Directory.Name=""c:\\\\dsr\Pete""'") Do Set objLatestEvent = colMonitoredEvents.NextEvent Wscript.Echo "New DSR Data Availabel for Pete please contact Phil or Ryan. . . Thank You. Have a nice day!" Loop strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & _ strComputer & "\root\cimv2") Set colMonitoredEvents = objWMIService.ExecNotificationQuery _ ("SELECT * FROM __InstanceCreationEvent WITHIN 300 WHERE " _ & "Targetinstance ISA 'CIM_DirectoryContainsFile' and " _ & "TargetInstance.GroupComponent= " _ & "'Win32_Directory.Name=""c:\\\\dsr\Pete""'") & "'Win32_Directory.Name=""c:\\\\dsr\Rob""'") Do Set objLatestEvent = colMonitoredEvents.NextEvent Wscript.Echo "New DSR Data Availabel please contact Phil or Ryan. . . Thank You. Have a nice day!" Loop strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & _ strComputer & "\root\cimv2") Set colMonitoredEvents = objWMIService.ExecNotificationQuery _ ("SELECT * FROM __InstanceCreationEvent WITHIN 300 WHERE " _ & "Targetinstance ISA 'CIM_DirectoryContainsFile' and " _ & "TargetInstance.GroupComponent= " _ & "'Win32_Directory.Name=""c:\\\\dsr\Pete""'") Do Set objLatestEvent = colMonitoredEvents.NextEvent Wscript.Echo "New DSR Data Availabel for Pete please contact Phil or Ryan. . . Thank You. Have a nice day!" & "'Win32_Directory.Name=""c:\\\\dsr\Rob""'") Do Set objLatestEvent = colMonitoredEvents.NextEvent Wscript.Echo "New DSR Data Availabel for Rob please contact Phil or Ryan. . . Thank You. Have a nice day!" Loop I could go on for a while but none of them work. . .
  5. WOW looks like you puta lot of work into that and I want to thank you. I think you did more thant we need. LEt me explaine a little better. I have 5 salesmen on the road. When they get a order thy send it in to a folder on the server. Once the file is on the server we know to go ahead and process the order. What I want to do is have the script running on all of our computers so when a file is placed in f:\dsr\pete or f:\dsr\rob or f:\dsr\mike or f:\dsr\denice it will pop up a alert tellimg me data is available. .. The script above works for one folder but I have to run four scripts (one for each folder) to get it to monitor all of them. Thanks for any more help you can give me! Ryan
  6. Hello, I have a simple VBS script that lets me know when data has been added to a folder. This is so when a person adds data i do not have to keep looking every hour. THe script will announce to me that data has arrived. What i want to do is have it check several folders The script below checks one folder fine but i can not figure out how to have it check multiple folders. Right now i have 3 scripts i have to start on every computer. It would be easier to just have one. . . Can someone help? ALSO is it possable to have the alert pop to the front of the screen. This will help grab attention. Thanks a Million strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & _ strComputer & "\root\cimv2") Set colMonitoredEvents = objWMIService.ExecNotificationQuery _ ("SELECT * FROM __InstanceCreationEvent WITHIN 300 WHERE " _ & "Targetinstance ISA 'CIM_DirectoryContainsFile' and " _ & "TargetInstance.GroupComponent= " _ & "'Win32_Directory.Name=""f:\\\\dsr\\\\Pete""'") Do Set objLatestEvent = colMonitoredEvents.NextEvent Wscript.Echo "New DSR Data Availabel for Pete please contact Phil or Ryan. . . Thank You. Have a nice day!" Loop Each folder is located in hte f:\dsr directory. . . Thanks!
×
×
  • Create New...