C # Window Directory
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
+3
user1307632
source
to share
4 answers
Try this in C #. This will help you get the Windows directory.
String Text= Environment.GetEnvironmentVariable("windir");
+5
ganesshkumar
source
to share
It should be Path.GetPathRoot(Environment.SystemDirectory)
in C #.
+2
CharlesB
source
to share
You can use a SystemDirectory
class property System.Environment
in C #.
+1
Mithrandir
source
to share
For C # to be Path.GetPathRoot(Environment.SystemDirectory)
, this will give you the root path like "C: \"
+1
Wouter huysentruit
source
to share