Jump to content

How to open IE and load a URL on WinNT?


fabio
 Share

Recommended Posts

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

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

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

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

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

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

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...