How do I find the section where windows are installed using java or c #? so the access to the files will be dynamic on different computers, i.e. it will refer to C: of D: where windows are installed
Try this in C #. This will help you get the Windows directory.
String Text= Environment.GetEnvironmentVariable("windir");
It should be Path.GetPathRoot(Environment.SystemDirectory) in C #.
Path.GetPathRoot(Environment.SystemDirectory)
You can use a SystemDirectory class property System.Environment in C #.
SystemDirectory
System.Environment
For C # to be Path.GetPathRoot(Environment.SystemDirectory) , this will give you the root path like "C: \"