Sign in to follow this  
Followers 0
LWC

Script won't launch or won't exit after launching URLs in ShellExecute

19 posts in this topic

#1 ·  Posted (edited)

When I launch URLs via ShellExecute, it just opens the browser without launching the chosen URL.

If the browser was already open on a blank page, the script won't exit itself.

If the browser was already open on another URLs, only then does the script exit properly.

I use IE6.

Edited by LWC

Share this post


Link to post
Share on other sites



Post the code you're using. That'll help others help you.


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

ShellExecute("http://www.autoitscript.com")

Edited by LWC

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

never had a problem with that, and that function works fine for me whether the browser is open, closed, or whatever page its on.

I supect you have more to your code that which is causing your problem.

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

No, this happens even in a script that has nothing but this specific line.

Share this post


Link to post
Share on other sites

No, this happens even in a script that has nothing but this specific line.

Try typing the url in your windows 'RUN' box. If it doesn't work from there, it may be some windows/IE setting that's preventing it.

William

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

It works from RUN. Even more so, there's no problem if I use Run through AutoIt instead of ShellExecute:

Run(@ComSpec & ' /c start http://www.autoitscript.com')

What's going on?

Edited by LWC

Share this post


Link to post
Share on other sites

It doesn't matter what I use as it's a program others will use too. I can't tell them which browser to use.

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

This happen compiled also?

Yes.

may we see your script and know what web browsers you are using?

ShellExecute("http://www.autoitscript.com")

I use IE6.

Yes, the above code is enough as a script of its own to trigger the issue. Edited by LWC

Share this post


Link to post
Share on other sites

This doesn't seem to happen in IE8. Could this be about IE6? It also seems I'm not the first to experience it:

  • http://www.autoitscript.com/forum/index.php?showtopic=72561
  • http://www.autoitscript.com/forum/index.php?showtopic=76861

Share this post


Link to post
Share on other sites

Is IE your default Browser ?

If not make it and try again.

Share this post


Link to post
Share on other sites

You could try an alternative like this:

$url = "http://www.autoitscript.com"
Run(@ComSpec & ' /c Start "" ' & $url, @ScriptDir, @SW_HIDE)

Or use a DLL call to shell32.dll and shellexecute that way, I think that's what autoit does when you use ShellExecute(), but if you call it yourself you might be able to adjust it a little.

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

The alternative indeed works. So does this DLLCall suggestion.

I've submitted a request to fix ShellExecute to use the aforementioned DLLCall suggestion whenever it launches URLs.

Edited by LWC

Share this post


Link to post
Share on other sites

I don't know what the code behind ShellExecute is and how it differs from the alternative code. But for the most part ShellExecute has been working very well and for all we know the alternative has issues as well.

It might be worth investigating though. (Just saw your ticket appear, so I guess it will be investigated)

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