fabio Posted September 13, 2004 Posted September 13, 2004 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.
Matt @ MPCS Posted September 13, 2004 Posted September 13, 2004 You can open IE using the run command and "iexplore http://www.webaddress.com" *** Matt @ MPCS
Bartokv Posted September 13, 2004 Posted September 13, 2004 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)
ezzetabi Posted September 13, 2004 Posted September 13, 2004 Why not just: $url = 'http://www.hiddensoft.com/forum' Run(@comspec ' /c Start ' & $url,'',@swhide) ?
Matt @ MPCS Posted September 13, 2004 Posted September 13, 2004 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
Bartokv Posted September 13, 2004 Posted September 13, 2004 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...
Matt @ MPCS Posted September 13, 2004 Posted September 13, 2004 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
ezzetabi Posted September 13, 2004 Posted September 13, 2004 (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 (tested before posting) Edited September 13, 2004 by ezzetabi
Matt @ MPCS Posted September 13, 2004 Posted September 13, 2004 Like I said, I wasn't sure. I have only seen it done like that on NT series machines. Thanks for the tip though! *** Matt @ MPCS
Bartokv Posted September 13, 2004 Posted September 13, 2004 ... 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.
sugi Posted September 14, 2004 Posted September 14, 2004 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 (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+.
emmanuel Posted September 14, 2004 Posted September 14, 2004 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)
ezzetabi Posted September 14, 2004 Posted September 14, 2004 So... $url = 'http://www.hiddensoft.com/forum' Run(@comspec ' /c Start "" ' & $url,'',@swhide)
fabio Posted September 14, 2004 Author Posted September 14, 2004 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) 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.
emmanuel Posted September 14, 2004 Posted September 14, 2004 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)
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now