File did not opened in IE


This Content is from Stack Overflow. Question asked by Mahesh M

I’m trying to open the file in Internet Explorer. I’m using the below code. When IE was already open, the code worked; otherwise, it did not.


try {
Runtime.getRuntime().exec("C:Program FilesInternet Exploreriexplore.exe" + " " + "file:///" + filepath);
} catch (Exception exc) {


check the solution

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?