How to launch a file protocol URL with an anchor from Java?

For Windows only, you could try System. Exec("cmd. Exe start file:///C:/foo/bar.

Html#anchor").

That method loses the anchor. The browser opens at the top of the file. – Jeff C Nov 19 '08 at 14:16.

You could try using BrowserLauncher2. It's a small and self-contained cross-platform library to open the default browser. It handles anchors perfectly.

I tried 'BrowserLauncher2'. It doesn't support anchors like all other solutions (rundll, Desktop. GetDesktop, ...).

Solution on Windows is: rundll32 URL. Dll, FileProtocolHandler "file:///x:/temp/fragtest. Htm#frag" Mind the quotes!

Rundll32 URL. Dll, FileProtocolHandler file:///x:/temp/fragtest. Htm#frag does work as expected.

I've done some investigation on this item here - note that opening cmd and typing start file:///c:/temp/test. Html#anchor also doesn't work. I think the only thing that actually works is to call a browser manually (or use a third-party tool that does this).

On Windows, you always have Internet Explorer, so you could call Runtime.getRuntime(). Exe start iexplore " + myURL) if you really don't want to find iexplore. Exe yourself - but this doesn't always work either.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions