Doppio Posted October 27, 2006 Share Posted October 27, 2006 How can this code be modified to allow only one instance of Iexplorer to Run. While 1 If ProcessExists('IExplorer.exe') Then Do ProcessClose('IExplorer.exe') Until Not ProcessExists('IExplorer.exe') EndIf Sleep(10) WEnd Thank you Link to comment Share on other sites More sharing options...
GaryFrost Posted October 27, 2006 Share Posted October 27, 2006 look at ProcessList SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 27, 2006 Moderators Share Posted October 27, 2006 Do you know the PID of the one you want to keep? If so gafrosts suggestion would be fine. If not, you'll never know which one you are killing. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
GaryFrost Posted October 27, 2006 Share Posted October 27, 2006 Do you know the PID of the one you want to keep? If so gafrosts suggestion would be fine. If not, you'll never know which one you are killing.if not he's SOL anyways. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Doppio Posted October 27, 2006 Author Share Posted October 27, 2006 This is what I got so far #NoTrayIcon While 1 $list = ProcessList('IExplorer.exe') $1 = "IExplorer.exe" If $list [0][0] > 1 Then ProcessClose('IExplorer.exe') EndIf Sleep(10) WEnd So far it works. Do you see anything that can be improved? if not thank you for your input. Link to comment Share on other sites More sharing options...
jvanegmond Posted October 27, 2006 Share Posted October 27, 2006 So far it works. Do you see anything that can be improved? if not thank you for your input. Yes, don't define $1. It's not used. #NoTrayIcon While 1 $list = ProcessList('IExplorer.exe') If $list [0][0] > 1 Then ProcessClose('IExplorer.exe') EndIf Sleep(10) WEnd github.com/jvanegmond Link to comment Share on other sites More sharing options...
Doppio Posted October 27, 2006 Author Share Posted October 27, 2006 Yes, don't define $1. It's not used. #NoTrayIcon While 1 $list = ProcessList('IExplorer.exe') If $list [0][0] > 1 Then ProcessClose('IExplorer.exe') EndIf Sleep(10) WEnd Leftover from my tests. thank you. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 27, 2006 Moderators Share Posted October 27, 2006 (edited) So you don't care which instance of IE is closed, just that there is always one? @Mandar Yes, don't define $1. It's not used. #NoTrayIcon While 1 $list = ProcessList('IExplorer.exe') If $list [0][0] > 1 Then ProcessClose('IExplorer.exe') EndIf Sleep(10) WEndoÝ÷ Ûú®¢×ºÚ"µÍÚ[HBYPÝ[ ØÙÜÓÝ ÌÎNÒQ^Ü^IÌÎNÊJHHH ÝÈH[ØÙÜÐÛÜÙJ ÌÎNÒQ^Ü^IÌÎNÊBÛY L BÑ[ Edited October 27, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. 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