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.

Opening a 'file:' URL an Anchor

Keywords: 	 anchor htm html open file

Question:

I want to do this with the default browser (i.e., I don't want to specify which browser to run). This runs just fine:
	URL = "file://F:\path\file.htm"
	RunShell("cmd.exe", StrCat("/c start ", URL), ".", @NORMAL, @NOWAIT)
But if URL = "file://F:\path\file.htm#Introduction", I get a 'Problem with Shortcut' dialog stating 'Unable to open "file://F:\path\file.htm#Introduction"'.

Note that a bookmark in an "http:" URL works with RunShell.

Answer:

  1. The #Introduction part might be confusing the issue. Generally it is information retained by the Browser.

  2. Try the ShellExecute function instead of RunShell.

  3. If that failes I can tell you how to make an Internet shortcut. Basically make an error occur, click on our connect to tech support link, then go look in your TEMP directory for a file like $$$TEMP.url

    View this file in DOS to see its structure. We just ShellExecute the file to make the connection.

Question (continued):

I tried ShellExecute and the Internet shortcut some time ago. Both produce the same error as RunShell.

So does running "file://F:\path\file.htm#Introduction" from Start->Run.

I think it's because the "#Introduction" obscures the .htm extension. Sure wish I knew a way to do this without registry lookups.

Answer:

The # introduction is the responsibility of the Browser. It should strip the #Introduction off. Apparently the browser you are using is not.
Article ID:   W13356
Filename:   Opening an HTM File with an Anchor.txt
File Created: 1999:04:15:16:53:28
Last Updated: 1999:04:15:16:53:28