Jump to content

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


gerly
 Share

Recommended Posts

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

Link to comment
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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...