Home > Default > How to open and display htm file in iexplore

How to open and display htm file in iexplore

October 11Hits:0
Advertisement
Friends,
Lets say i have a .htm file and its in the location of C:\BAPI_CUSTOMER_GETSALESAREAS\SALESAREAS.HTML , now i want to open that file in internet explorer when some one click on a particular button this would be happend.
I write following code :
import java.io.*;
public class Test{
public static void main(String[] args){
try{
     String command = "cmd /c start C:\BAPI_CUSTOMER_GETSALESAREAS\SALESAREAS.HTML";
          Runtime.getRuntime().exec(command);
          /* Runtime rt = Runtime.getRuntime( );
          rt.exec( "IEXPLORE.EXE" );
          return;*/
}catch(Exception e){
     e.printStackTrace();
This will give me the error due to specifying the path of html pages, will you tell me how to achieve that.
Thanks.
Hitz

Answers

u hav't given escape seq in
String command = "cmd /c start C:\BAPI_CUSTOMER_GETSALESAREAS\SALESAREAS.HTML";replace all \ by \\ it wil work..
ie.
String command = "cmd /c start C:\\BAPI_CUSTOMER_GETSALESAREAS\\SALESAREAS.HTML";

Read other 3 answers

Tags:

Related Articles

Copyright (C) 2019 wisumpire.com, All Rights Reserved. webmaster#wisumpire.com 14 q. 0.713 s.