Jump to content

Recommended Posts

Posted

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

Posted

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

Posted

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

Posted

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
Posted

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

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
×
×
  • Create New...