Not hard coding the iexplorer path
Hi
I was looking around and saw this piece of code posted by Cotton.m:
publicclass IETest{
publicfinalstatic String browserPath ="C:\\Program Files\\Internet Explorer\\iexplore.exe";
publicstaticvoid main(String args[])throws Exception{
String[] urls ={"http://forum.java.sun.com","http://www.cnn.com","http://www.google.com"};
for(int i=0;i<urls.length;i++){
launchPage(urls[i]);
}
}
publicstaticvoid launchPage(String pageName)throws Exception{
String[] launchPath =new String[2];
launchPath[0] = browserPath;
launchPath[1] = pageName;
Runtime.getRuntime().exec(launchPath);
}
}
Does anyone know how to not hardcode the browserPath? or is that impossible... I'm doing something similar but I open files... is there a way that I don't need to hard code the path name? or am i asking too much?
Cheers>

