Runtime.getRuntime().exec(cmd)
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Veda_Patil
Posted On:   Wednesday, October 12, 2005 01:56 AM

Hi , What should be done if i want to open the html file , the existing open browser. The scenario is something like this : I run the program i open the page "C:\test.html" This launches the browser. Now i run the program again,this will launch second instance of the browers opening the same file. What i am trying is ,if you are running the application and you already have the browser open then the file should be opened in the same browser window. Code snippet : String[] cmd = new String[3]; cmd[0] = "cmd.exe" ; cmd[1] = "/C" ; cmd[2] = "C:\test.html"; Runtime rt = Runtime.getRuntime(); Process   More>>

Hi ,

What should be done if i want to open the html file , the existing open browser.
The scenario is something like this :
I run the program i open the page "C:\test.html"
This launches the browser.

Now i run the program again,this will launch second instance of the browers opening the same file.

What i am trying is ,if you are running the application and you already have the browser open then the file should be opened in the same browser window.


Code snippet :
String[] cmd = new String[3];

cmd[0] = "cmd.exe" ;
cmd[1] = "/C" ;
cmd[2] = "C:\test.html";
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec(cmd);


Any help in this regard would be of great help to me.

Thanks & Regards,
Nivedeeta

   <<Less

Re: Runtime.getRuntime().exec(cmd)

Posted By:   Stephen_Ostermiller  
Posted On:   Wednesday, October 12, 2005 02:25 PM

I wrote code that tries to do exactly this:

http://ostermiller.org/utils/Browser.html
About | Sitemap | Contact