Need informatin to get OS directory
Hiz
I want to get OS root directory since program files i.e C:\Program Files
i want to get C:\Program Files this path please any one can help me
reason to getting this path is in spanish OS path is C:\Archivos de programa and i want to access IEXPlorer.exe
so kindly respond me as soon as possible
thankin in anticipation
Muhamma Abid
[379 byte] By [
Chaudhrya] at [2007-11-26 23:51:15]

Yes i have to access program file path
My code is there it will work on two system that on English or Spanish
if i get exact Path till Program Files than my program will run on any OS system like on German Chinese etc
if someone know plz help me my code is below:
try
{
String strUserHome = System.getProperty("user.home");
String strProgram = strUserHome.substring(0, 2);
String strProgramCommand = strProgram
+ "/Program Files/Internet Explorer/IEXPLORE.EXE";
String strHelpPage = System.getProperty("user.dir")+"/bin/help.html";
System.out.println("Operating System Architecture : = " + System.getProperty("os.arch"));
System.out.println("Operating System Architecture : = " + System.getProperty("java.ext.dirs"));
try{
Runtime.getRuntime().exec(
new String[] { strProgramCommand, strHelpPage });
}catch(IOException ioexp){
System.out.println("'Program File' name in this OS is 'Archivos de programa'");
strProgramCommand = strProgram
+ "/Archivos de programa/Internet Explorer/IEXPLORE.EXE";
Runtime.getRuntime().exec(
new String[] { strProgramCommand, strHelpPage });
}
}
catch (Exception objException)
{
objException.printStackTrace();
}
> Yes i have to access program file path
> My code is there it will work on two system that on
> English or Spanish
No, it will fail on mine. I have an English OS, but I have installed the applications in the folder "programs".
And as I said, the user might not even use the browser that you are trying to launch. I never use IE I do always use Firefox. Read my previous reply about the Desktop class, and the browse method.
Kaj
kajbja at 2007-7-11 15:29:47 >

Use the rundll32.exe and the FileProtocolHandler and url.dll in a call to runtime exec, and add the url you want to open.
Runtime.getRuntime().exec("cmd /c rundll32.exe url.dll,FileProtocolHandler http://www.google.com");
Message was edited by:
SomeoneElse