Sign in to follow this  
Followers 0
gerly

how to open Ie and close it after some seconds and repeat it forever

8 posts in this topic

Hello to all the people over here;

i'm a new user (from today) of this tools.

I'd like to open each hour internet explorer with an url and after 20 seconds I'd like to close it

I tryed this

Run('C:\Program files\Internet Explorer\IEXPLORE.EXE "http://www.google.it/search?hl=eng&q=test"')

WinWait("test","Done")

sleep (20000)

while WinExists

if winexists("test","") then winclose("test","")

wend

what happen is that internet eplorer is quickly open and never closed.

How to force to close internet explorer?

How to force to repeat this code each hour?

Best regards to all.

Roberto Gerlando

Share this post


Link to post
Share on other sites



While 1

Run('C:\Program files\Internet Explorer\IEXPLORE.EXE "http://www.google.it/search?hl=eng&q=test"')

sleep (20000)

if ProcessExists("IEXPLORE.EXE") then

ProcessClose("IEXPLORE.EXE")

EndIf

wend


READ BEFORE POSTINGMy UDF'sMessagesYou say plz because its shorter than please. I say no because its shorter than yes.Join My Website

Share this post


Link to post
Share on other sites

Thank you for your help!

But i think that with your useful code all internet explorer will be closed and i'd like to close only internet explorer with the ' test title '

Am I worng?

Regards

Share this post


Link to post
Share on other sites

I forget: how to repeat it each hour? using scheduled tasks?

Regards

Share this post


Link to post
Share on other sites

I don't know about the hour thing but this works

Opt("WinTitleMatchMode",2)
While 1
Run('C:\Program files\Internet Explorer\IEXPLORE.EXE "http://www.google.it/search?hl=eng&q=test"')
sleep (20000)
If WinExists("test") then
WinClose("test")
EndIf
wend

READ BEFORE POSTINGMy UDF'sMessagesYou say plz because its shorter than please. I say no because its shorter than yes.Join My Website

Share this post


Link to post
Share on other sites

Thank you very much; now I just search for how to repeat it each hour

tnx again

Regards

Share this post


Link to post
Share on other sites

this should be a little more flexible, b/c it doesn't care about the name of the window

#include <IE.au3>
while 1
$oIE = _IECreate()
    _IENavigate($oIE, "http://www.google.it/search?hl=eng&q=test")
    _IELoadWait ($oIE)
    Sleep(3600000)
_IEQuit ($oIE)
sleep(100)
WEnd

leave the sleep(100) in there to give the comp a little time between starting up a new IE, b/c often it will start a new one before the old one is closed and it will get confused for about 1 round

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