parkerbl Posted December 19, 2006 Share Posted December 19, 2006 Hey guys...I have once again came to seek the help from you guys. I'm sure that it is something really simple, and it might be something that I am overlooking, but I can't seem to find anything to resolve this. What I am wanting to do basically is this. I need a program that is constantly running and checking to see if IE is running. If IE is terminated, it opens up a new window according to that shortcut. So, I have this program in a constant while loop checking to see if the IE process exists, and if it doesn't exist, then run that shortcut. I can't just open a new IE window, because the shortcut runs an IE window that is a full screen document. So basically is there any way to just run a shortcut in the same directory. Thanks if advance guys. Link to comment Share on other sites More sharing options...
parkerbl Posted December 19, 2006 Author Share Posted December 19, 2006 Well, I have seemed to figure out some kind of solution for it. I just have the AutoIT script in a loop testing to see if the internet explorer process exists, and if it doesn't, then run a batch file that points to that shortcut. But when that AutoIT script is running that is checking to see if the internet explorer window is open, it is a loop and it is taking up 98/99 percent of memory. Is there any other way to constantly monitor the processes, and open a process if one is closed? Link to comment Share on other sites More sharing options...
JoshDB Posted December 19, 2006 Share Posted December 19, 2006 While 1 If ProcessExists("ie.exe") Then Run("Whatever.exe") EndIf Sleep(100) WEnd Is this what you're looking for? Ha, I haven't been on these forums since... 2006, almost. Behold, my legacy signature:My AutoIt idol is Valuater. You know you love him, too.My Stuff: D&D AGoT Tools Suite Link to comment Share on other sites More sharing options...
kjmarket Posted December 19, 2006 Share Posted December 19, 2006 Without seeing your code, its hard to help, but do you have any sort of pause between executions of the loop? Pink Floyd - The Wall Link to comment Share on other sites More sharing options...
Geert Posted December 19, 2006 Share Posted December 19, 2006 To idle the cpu: add a sleep statement in the loop (as in post #3) To start a shortcut: $file = "MyShortcut.lnk" Run("rundll32 url.dll, FileProtocolHandler " & $file) Link to comment Share on other sites More sharing options...
parkerbl Posted December 20, 2006 Author Share Posted December 20, 2006 Hey guys, thanks for the help so much. All of you guys have been a tremendous help. Here's what I ended up doing that seems to work fine: CODERun("C:\run.bat") ProcessWait("iexplore.exe") Call("process") Func process() ProcessWaitClose("iexplore.exe") Run("C:\run.bat") ProcessWait("iexplore.exe") Call("process") EndFunc Link to comment Share on other sites More sharing options...
Helge Posted December 20, 2006 Share Posted December 20, 2006 (edited) parkerbl... You obviously don't understand the use of Call. Call is to be used when you don't knowthe function-name to call at the time you write the script, and can be used to create dynamic scripts :$num = @SEC Call("myfunc" & $num)oÝ÷ Ù*,wʤ-çîËb¢yÚæ¶g²¢ì+×ë®*m¶«{lÞjÊ'¶¬x&¥»{-y§r¢ë!¢é]q©e¶ºw-Ý·¶¥G+ºÚ"µÍØÙÜÊ oÝ÷ Ù'¢weË*.ßÚÞ±Êâ¦Ü"W«®èºÖµêÚÂ¥zȧq쨺·îËb¢yÚçjºi®²Ê®¢×["¶Ç¥~W¾)àÙèÁ¬¡ëjçîËb¢r7ö÷®±çZ²v¤y«ëZ¦+mçèæ§u¨|Z²v¤y¸x"·l£ íj)H·¥éݺ"¶h¶ÊnZ(v +y©Ý¢w®º+ë,j¢{Zx§Ø^Âݪê-ç.®È¯z«¨µ:ò²¶§X¤zØb²)ìµæjëh×6Run("C:\run.bat") ProcessWait("iexplore.exe") While 1 ProcessWaitClose("iexplore.exe") Run("C:\run.bat") ProcessWait("iexplore.exe") WEndEDIT : Added the two lines in start of code.. Edited December 20, 2006 by Helge 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