• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to get windows root directory  RSS feed

 
manucng davangere
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Freddy Wong
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Windows, there is a built-in environment variable, called windir. You can use System.getenv("windir") in java.
 
manucng davangere
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!