Sign in to follow this  
Followers 0
Skrip

Prgram Detection

11 posts in this topic

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]

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

If FileExists(@ProgramFilesDir & "\Internet Explorer\iexplore.exe") Then MsgBox(0, "title", "Hey, I found Internet Explorer!")

Try with the helpfile next time.

Edited by erebus

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

:P

WinExists()

FileExists()

ProcessExists()

If/Then

Select/Case/EndSelect

Switch/Case/EndSwitch

Those things didn't help in your search?

Edited 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.

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 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]

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

#6 ·  Posted (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 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]

Share this post


Link to post
Share on other sites

#7 ·  Posted (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.")

Exit

EndIf

Just because they have the program Internet Explorer, doesn't neccesarily mean that they are connected to the internet :P.

Edited 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.

Share this post


Link to post
Share on other sites

Just because they have the program Internet Explorer, doesn't neccesarily mean that they are connected to the internet

I 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]

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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)


NEWHeader1.png

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0