Sign in to follow this  
Followers 0
fabio

How to open IE and load a URL on WinNT?

15 posts in this topic

Guys, I need some help.

I need to use _ShellExecute to open IE and load a URL , but it doesn´t work on Windows NT.

Can anyone help me?

Thanks.

Share this post


Link to post
Share on other sites



You can open IE using the run command and "iexplore http://www.webaddress.com"

*** Matt @ MPCS

Share this post


Link to post
Share on other sites

Another way is to use the computer's registered browser:

$Browser = "rundll32 url.dll,FileProtocolHandler"
$URL = "http://www.google.com"
$Launch =  "START /MIN " & $Browser & " " & $URL
Run(@ComSpec & " /c " & Chr(34) & $Launch & Chr(34), "", @SW_HIDE)

Share this post


Link to post
Share on other sites

Why not just:

$url = 'http://www.hiddensoft.com/forum'
Run(@comspec ' /c Start ' & $url,'',@swhide)

?

Share this post


Link to post
Share on other sites

ezzetabi's solution is effectivly the same as mine except it won't work on Win95 and might not work on 98/Me... havent tested it.

*** Matt @ MPCS

Share this post


Link to post
Share on other sites

I've noticed that on a few different platforms that the IE browser executable "iexplore.exe" doesn't always reside within the system paths. So calling "iexplore http://www.google.com" doesn't always work. Likewise, URL formatting isn't always recognized by all mime-type librarys; so using a url by itself will also occasionally result in an error.

Just FYI...

Share this post


Link to post
Share on other sites

I am well aware of that fact, but at the same time using the 'registered browser' as used in your solution,

"rundll32 url.dll,FileProtocolHandler"

is not supported by the same versions as ezzetabi's solution. It doesn't appear there is a perfect solution here.

*** Matt @ MPCS

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

I am using a W98 computer and my solution works. And IT IS NOT the same since it use the default browser instead of IE, that I have not installed anyway :ph34r:

(tested before posting)

Edited by ezzetabi

Share this post


Link to post
Share on other sites

Like I said, I wasn't sure. I have only seen it done like that on NT series machines. Thanks for the tip though! :ph34r:

*** Matt @ MPCS

Share this post


Link to post
Share on other sites

... but it doesn´t work on Windows NT.

<{POST_SNAPBACK}>

My post was just provided as an fyi to fabio's request for help within the Windows NT environment. I wanted to provide an example that I have used with great success within the NT, 2000, and XP environments.

Share this post


Link to post
Share on other sites

I am using a W98 computer and my solution works. And IT IS NOT the same since it use the default browser instead of IE, that I have not installed anyway :ph34r:

(tested before posting)

<{POST_SNAPBACK}>

The problem with
start http://...
is that the start command is a little bit different in Win9x and NT4+.

Syntax in Win9x:

start "<command, filename or ressource>"

Syntax in NT4+:

start "New title of command line window" "<command, filename or ressource>"

When only one parameter is given, it's interpreted as the command part.

So you see the difference? Everytime you need to use quotes you need to create a version for Win9x and a different one for NT4+.

Share this post


Link to post
Share on other sites

The problem with

start http://...
is that the start command is a little bit different in Win9x and NT4+.

Syntax in Win9x:

start "<command, filename or ressource>"

Syntax in NT4+:

start "New title of command line window" "<command, filename or ressource>"

When only one parameter is given, it's interpreted as the command part.

So you see the difference? Everytime you need to use quotes you need to create a version for Win9x and a different one for NT4+.

<{POST_SNAPBACK}>

so, if you know you're going to be operating in both environments do a little creative if then work with @OSTYPE and/or @OSVERSION

"I'm not even supposed to be here today!" -Dante (Hicks)

Share this post


Link to post
Share on other sites

So...

$url = 'http://www.hiddensoft.com/forum'
Run(@comspec ' /c Start "" ' & $url,'',@swhide)

Share this post


Link to post
Share on other sites

:(

Thank you all, i solved the problem with WinNT. But can you tell me if this code work with Win9x?

$Browser = "rundll32 url.dll,FileProtocolHandler"

$Launch = "START /MIN " & $Browser & " " & $Tela1

Run(@ComSpec & " /c " & Chr(34) & $Launch & Chr(34), "", @SW_HIDE)

:ph34r:

And i´ve got still one problem:

I need the script to wait while other given URL is loaded. The script works fine with IE, but i should develop it for Mozilla, Netscape and Opera.

Is there a way to do it?

Thanks again.

Share this post


Link to post
Share on other sites

And i´ve got still one problem:

I need the script to wait while other given URL is loaded. The script works fine with IE, but i should develop it for Mozilla, Netscape and Opera.

Is there a way to do it?

Thanks again.

<{POST_SNAPBACK}>

This is a classic problem, and there's not one solid answer. Most of them aim at using a pixel checksum to see when the little progress bar is all the way across, or to detect that the word done is there.

"I'm not even supposed to be here today!" -Dante (Hicks)

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