myspacee Posted May 15, 2009 Share Posted May 15, 2009 hello, try to monitor several directory that receive files randomly. Encounter problem when 1 file come in and 1 file is deleted, so i can't take number of files as valid check, Think to use size (kb) of directory, but don't know how to monitor this... (and its performance) any brillant idea to script valid directory monitor ? thank you, m. Link to comment Share on other sites More sharing options...
toonboon Posted May 15, 2009 Share Posted May 15, 2009 DirGetSize() [right]~What can I say, I'm a Simplistic person[/right] Link to comment Share on other sites More sharing options...
Zedna Posted May 15, 2009 Share Posted May 15, 2009 Sysinternals - www.sysinternals.com Filemon Filemon is an application that monitors and displays all file system activity on a system. It has advanced filtering and search capabilities that make it a powerful tool for exploring the way Windows works, seeing how applications use the files and DLLs, or tracking down problems in system or application configurations. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
zorphnog Posted May 15, 2009 Share Posted May 15, 2009 Check out this topic: http://www.autoitscript.com/forum/index.ph...st&p=520303. You can get notifications for files that are: created, deleted, modified, and renamed. Link to comment Share on other sites More sharing options...
rajeshontheweb Posted May 16, 2009 Share Posted May 16, 2009 thats nice, didnt know that api calls also were already available in autoit. i use this vb script when needed(WMI) strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colMonitoredEvents = objWMIService.ExecNotificationQuery _ ("SELECT * FROM __InstanceOperationEvent WITHIN 10 WHERE " _ & "Targetinstance ISA 'CIM_DirectoryContainsFile' and " _ & "TargetInstance.GroupComponent= " _ & "'Win32_Directory.Name=""c:\\\\scripts""'") Do While TRUE Set objEventObject = colMonitoredEvents.NextEvent() Select Case objEventObject.Path_.Class Case "__InstanceCreationEvent" Wscript.Echo "A new file was just created: " & _ objEventObject.TargetInstance.PartComponent Case "__InstanceDeletionEvent" Wscript.Echo "A file was just deleted: " & _ objEventObject.TargetInstance.PartComponent End Select Loop PS: this monitors only creation and deletion! probably u can query size and then monitor for size change... this is from ms website raw code. mine does have adaptation to my requiremnts.. Started late is much better than having never started it!!!!Failure is another step towards success. I've been messing around with: Adding Entry to 'Hosts'File Information Lister (Logger)Yet Another AutoIT Error Handler Yet Another AutoIT Error Handler & Debugger Control your App's TaskBar Button YCurrency Ticker (Latest Release : 16 Apr 2009)_WinInetInternetCheckConnection UDF Symantec Definitions Lister UDF _GetLocalIPAddresses UDF UDF to get Special Folder Information WMI_NetworkAdapterConfiguration2Array WMI_CDRomDriveCapabilities _ScriptExists - Check if your au3 script is running!! Uninstaller UDF Get Version for your application (at script level or compiled stage) Uninstaller Pro - faster alternative to windows application removal applet Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now