Loading |
VBScript |
JavaScript |
Powershell |
Search Options: Automatically Open New Files Added to a FolderContent of Automatically Open New Files Added to a Folder.vbsMD5 Hash: 09E802A6E207C1B883CDF59F55121B29 |
||
Set objShell = CreateObject("Wscript.Shell")
strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colMonitoredEvents = objWMIService.ExecNotificationQuery _ ("SELECT * FROM __InstanceCreationEvent WITHIN 10 WHERE " _ & "Targetinstance ISA 'CIM_DirectoryContainsFile' and " _ & "TargetInstance.GroupComponent= " _ & "'Win32_Directory.Name=""c:\\\\scripts""'") Do Set objLatestEvent = colMonitoredEvents.NextEvent strNewFile = objLatestEvent.TargetInstance.PartComponent arrNewFile = Split(strNewFile, "=") strFileName = arrNewFile(1) strFileName = Replace(strFileName, "\\", "\") strFileName = Replace(strFileName, Chr(34), "") objShell.Run("notepad.exe " & strFileName) Loop | ||
© 2008 - 2013 Boris Toll :: Scripts available: 6.481 :: :: scriptbox.toll.at :: :: powered by www.toll.at :: |