How to get the system partition

  • Thread starter Thread starter Rainer Faulstich
  • Start date Start date
R

Rainer Faulstich

Hi,

I need to get the directory i.e. the partition of the system directory
for XP .

I need to create a file - in the "?:/windows/system32" directory . But
in which partition is is located ?. I think for everyone writing
installers this is a "klacks" - i.e. "nothing to think about it" as we
call it in germany .

Please Think about it

Rainer
 
Rainer Faulstich said:
Hi,

I need to get the directory i.e. the partition of the system directory
for XP .

I need to create a file - in the "?:/windows/system32" directory . But
in which partition is is located ?. I think for everyone writing
installers this is a "klacks" - i.e. "nothing to think about it" as we
call it in germany .

Please Think about it

Rainer

Read the Environment variable "SystemDrive", or better use
Environment.SpecialFolder.System to get the system32 path.

string systemDrive = Environment.ExpandEnvironmentVariables(%SystemDrive%);

string s = Environment.GetFolderPath(Environment.SpecialFolder.System);

Willy.
 
Back
Top