Skrip Posted December 16, 2005 Share Posted December 16, 2005 How can you have it check for a program...say internet explorer. have it just keep checking until it finds the program, then have it execute something. (I did a search and got no help) [left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left] Link to comment Share on other sites More sharing options...
erebus Posted December 16, 2005 Share Posted December 16, 2005 (edited) If FileExists(@ProgramFilesDir & "\Internet Explorer\iexplore.exe") Then MsgBox(0, "title", "Hey, I found Internet Explorer!") Try with the helpfile next time. Edited December 16, 2005 by erebus Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted December 16, 2005 Moderators Share Posted December 16, 2005 (edited) WinExists() FileExists() ProcessExists() If/Then Select/Case/EndSelect Switch/Case/EndSwitch Those things didn't help in your search? Edited December 16, 2005 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...
Skrip Posted December 17, 2005 Author Share Posted December 17, 2005 (edited) Sorry for the bump, but I don't want to make a new thread. I can't get the code to work, after 'Then' I want IE (Internet) to close please help! If $answer = 4 Then If FileExists(@ProgramFilesDir & "\Internet Explorer\iexplore.exe") Then WinClose Edited December 17, 2005 by Firestorm [left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left] Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted December 17, 2005 Moderators Share Posted December 17, 2005 Errr... that's cuz you're not entirely sure if the Window exists?? Opt("WinTitleMatchMode", 4) If WinExists("- Microsoft Internet Explorer") Then WinClose("- Microsoft Internet Explorer") or If ProcessExists("iexplore.exe") Then ProcessClose("iexplore.exe") 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...
Skrip Posted December 17, 2005 Author Share Posted December 17, 2005 (edited) Thanks you that worked, is there any way to completly disconnect from the internet? (IE, Messagers, Games, EVERYTHING) What I have: Sleep(300) If FileExists(@ProgramFilesDir & "\Internet Explorer\iexplore.exe") Then $answer = MsgBox(4, "Internet", "You are connected to the internet, continue?") If $answer = 7 Then MsgBox(0, "Internet", "You are still connected to the internet.") Exit EndIf $answer = MsgBox(4, "Internet", "Do you want to disconnect from the internet?") If $answer = 7 Then MsgBox(0, "Internet", "You are still connected to the internet.") Exit EndIf If ProcessExists("iexplore.exe") Then ProcessClose("iexplore.exe") Edited December 17, 2005 by Firestorm [left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left] Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted December 17, 2005 Moderators Share Posted December 17, 2005 (edited) a firewall?... lol just kidding... I don't know code for it personally, but I'm sure you could search around on how to lock the internet connection.Edit:If FileExists(@ProgramFilesDir & "\Internet Explorer\iexplore.exe") Then $answer = MsgBox(4, "Internet", "You are connected to the internet, continue?")If $answer = 7 Then MsgBox(0, "Internet", "You are still connected to the internet.") ExitEndIfJust because they have the program Internet Explorer, doesn't neccesarily mean that they are connected to the internet . Edited December 17, 2005 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...
Skrip Posted December 17, 2005 Author Share Posted December 17, 2005 Just because they have the program Internet Explorer, doesn't neccesarily mean that they are connected to the internetI know I changed my plans after a little bit, I just wanted to know if I was connected to internet (processexists or something like that) which I figured out no problem now I want to see if i'm commected to internet, if I am i want it to ask me if I want to disconnect, If I clicked yes then thats where I get the problem. [left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left] Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted December 17, 2005 Moderators Share Posted December 17, 2005 Someone will probably tell you how to do it with a ping or something... Good Luck! 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...
Valuater Posted December 17, 2005 Share Posted December 17, 2005 good idea smoke $var = Ping("www.AutoIt-ITS.com", 4000) If $var Then MsgBox(0, "Status", "Online, roundtrip was: " & $var) Else If @error = 0 Then $problem = "Network Errors Occured " If @error = 1 Then $problem = "Host is Off-Line " If @error = 2 Then $problem = "Host is Unreachable " If @error = 3 Then $problem = "Incorect Destination " If @error = 4 Then $problem = "Network Errors Occured " MsgBox(0, "Status", "An error occured with number: " & @error & @CRLF & $problem) EndIf 8) Link to comment Share on other sites More sharing options...
MrSpacely Posted December 18, 2005 Share Posted December 18, 2005 Simple Way to switch of internet is this #include <Process.au3> _RunDOS("ipconfig /release") at least if you have a dchp address it works great 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