j_stam_84 Posted May 23, 2005 Share Posted May 23, 2005 Hi everybody, Would it be possible with AutoIT to set up a global "monitor" and execute a command when opening a random file ? Grtz, JJ Link to comment Share on other sites More sharing options...
scriptkitty Posted May 23, 2005 Share Posted May 23, 2005 (edited) set up a loop, and monitor the processlist. when a new process is added, give it a random chance to do something. maybe something like this? $list1=ProcessList() while 1 sleep(5000) $list2 = ProcessList() if $list1[0][0]=$list2[0][0] then else $list1[0][0]=$list2[0][0] if int(random(1,6)=4 then dosomething() endif wend this will also randomly execute when a proccess stops. It is easy to change, just didn't want to do all the work for ya.... side note, this is when they open a random exe, if they just open an additional file in a program already open it wouldn't work. Edited May 23, 2005 by scriptkitty AutoIt3, the MACGYVER Pocket Knife for computers. Link to comment Share on other sites More sharing options...
j_stam_84 Posted May 25, 2005 Author Share Posted May 25, 2005 Hi scriptkiddy! Thanks for your reply Thought of that solution aswell but with that setup, the process would already be running.. and I don't want that I think it has to be something like with the IE example (don't have it here... ); when downloading, you can monitor the progress of the download (via the IE object). grtz, JJ Link to comment Share on other sites More sharing options...
MSLx Fanboy Posted May 25, 2005 Share Posted May 25, 2005 (edited) You could enumerate file handles linking to the certain file, and when the filehandle exists in Windows, have it run the function. I don't think AutoIt has it built in natively, however, there's probably a DLL for it already (Microsoft might have one built in )SysInternals has a GUI version to track applications and what files they access FileMon. There might be a CMDLine backend, but it atleast gives you an idea, I hope... Edited May 25, 2005 by MSLx Fanboy Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate()) 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