Sign in to follow this  
Followers 0
BlueScreen

Opening a web page using default browser

12 posts in this topic

I don't wanna be able to open a web page (like www.autoitscript.com) using the default browser. Is there a way?

10x

Share this post


Link to post
Share on other sites



I don't wanna be able to open a web page (like www.autoitscript.com) using the default browser. Is there a way?

10x

<{POST_SNAPBACK}>

Use the forum's search feature and search for "Default Browser". The information is there as this has been covered before...

Hope this helps,

JPC :)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

$Url = "http://www.autoitscript.com/forum/index.php?"
$OpenUrl = RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Applications\iexplore.exe\shell\open\command", ""); Get the Internet browser path
$PosParam    = StringInStr ($OpenUrl, "%")         ; Parameter location (%l)
$OpenUrlLeft  = StringLeft  ($OpenUrl, $PosParam-1)   ; Left handside of the path
$OpenUrlRight = StringMid   ($OpenUrl, $PosParam+2,999); Right handside of the path
Run ($OpenUrlLeft & $url & $OpenUrlRight)

From the topic mentioned above.

Edited by Burrup

[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Whoops my bad. Sorry I was supposed it modifiy it. Try this.

$Url = "http://www.autoitscript.com/forum/index.php?"
$OpenUrl = RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\https\shell\open\command", ""); Get the Internet browser path
$PosParam    = StringInStr ($OpenUrl, "%")       ; Parameter location (%l)
$OpenUrlLeft  = StringLeft  ($OpenUrl, $PosParam-1) ; Left handside of the path
$OpenUrlRight = StringMid   ($OpenUrl, $PosParam+2,999); Right handside of the path
Run ($OpenUrlLeft & $url & $OpenUrlRight)
Edited by Burrup

[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
Share on other sites

Thanks, Guys, for all your replies. I have finally used:

RunWait(@ComSpec & " /c " & "start http://www.blablabla.com", "", @SW_MAXIMIZE).

This is doing the job, but when there is a URL such as: www.blabla&bla, it doesn't work. I still wanna use Comspec. Any idea how to overcome this limitation?

Share this post


Link to post
Share on other sites

$Url = "http://www.autoitscript.com/forum/index.php?"

RunWait(@ComSpec & " /c start " & $Url)

? I'm not sure what you mean by www.blablabla.com, do you mean it doesnt work when it doesnt have "http://" infront of it?


[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
Share on other sites

I don't believe it will work without the "http://" because it doesn't know what protocol is going to be used, which means it doesn't know the default app to use, since it doesn't know the protocol...


Writing AutoIt scripts since
_DateAdd("d", -2, _NowCalcDate())

Share this post


Link to post
Share on other sites

Well I just used my above example without the "http://" and it works fine.


[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
Share on other sites

Thanks, Guys, for all your replies. I have finally used:

RunWait(@ComSpec & " /c " & "start http://www.blablabla.com", "", @SW_MAXIMIZE).

<{POST_SNAPBACK}>

i think you can RunWait("http://xxxx") directly

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