File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes how to get windows root directory Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "how to get windows root directory" Watch "how to get windows root directory" New topic
Author

how to get windows root directory

manucng davangere
Greenhorn

Joined: Aug 10, 2009
Posts: 12
Hi All,

Can any one tell me .how to get windows root directory in java.
i need code pr api which returns root directory of windows such as C:\WINDOWS,or D:\WINDOWS.
i want to store one dll other than current directory so i want to store in windows root directory.i should not hard code the path as i am not sure C,D will be exists in other Computers.

please help me.i have tried System.GetProperties,but no use.please give me some ideas or clue.

please help me .

regards,
manu


regards,
manu
Freddy Wong
Ranch Hand

Joined: Sep 11, 2006
Posts: 959

In Windows, there is a built-in environment variable, called windir. You can use System.getenv("windir") in java.


SCJP 5.0, SCWCD 1.4, SCBCD 1.3, SCDJWS 1.4
My Blog
manucng davangere
Greenhorn

Joined: Aug 10, 2009
Posts: 12
Thank you very much.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to get windows root directory
 
Similar Threads
Confusion on packages
How can we get Driver Info?
getting the root directory of the o.s
How do i get the dependent target for a specific target
how to get strut applications root directory