WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

URLs - Web - Browser Topics

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Launch Browser with a URL

Keywords:      netscape URL  browser

Question:

I'm trying to start netscape and pass it a url:
        Run("Netscape.exe", "")
        WinActivate("~Netscape")
        SendKeysTo("Netscape", "file://f:/nav/contents.htm")
Netscape starts, but SendKeysTo doesn't. Am I activating the correct window?

Answer:

  1. Netscape is not real good about puting the input focus on the optional Location window. Instead try....
    	Run("Netscape.exe", "")
    	SendKeysTo("Netscape","^ofile://f:/nav/contents.htm")
    
    The ^o in there will oprn the location input dialog box.

  2. Alternatively, you could do:
    	Run("d:\path\netscape.exe", "-hfile:///c|/autoexec.bat")
    
    -h says to start that session with the following url as the "homepage". It only starts with that url. If you press the "HOME" button, it will go to whatever default homepage you have.

  3. If you want to change the initial homepage permanently you can:
    RegSetValue(@REGCURRENT, "Software\Netscape\Netscape Navigator\Main[Home Page]","url-of-choice")
    Run("netscape.exe","")
    

  4. Actually if you...
    	ShellExecute("http://www.windowware.com","","",@NORMAL,"OPEN")
    
    That works.

To open URL without launching another instance of your Browser:

As described in Section 2.1.2, calling the Netscape executable with an URL as its parameter will always open up a new browser window. However, there is also a way of making your current browser window show a document. This approach uses the DLL url.dll. If you want to try it, issue the following command in a DOS shell:
rundll32 url.dll,FileProtocolHandler http://www.infosys.tuwien.ac.at
See:
http://www.infosys.tuwien.ac.at/Staff/pooh/Minstrel/Receiver/NRCF/concept/methods.html
and
http://www.javaworld.com/javaworld/javatips/jw-javatip66.html

Article ID:   W13351
Filename:   Launch Browser with URL.txt
File Created: 2001:05:18:16:18:22
Last Updated: 2001:05:18:16:18:22