Hi all,
please tell me how can i get system drive path.
thanks in advance.
Printable View
Hi all,
please tell me how can i get system drive path.
thanks in advance.
By searching 1 second in Google Groups :
http://groups.google.fr/group/comp.o...e5de2ea4e9c4f4
You either want the system drive or the system path!!!
Use GetWindowsDirectory or GetSystemDirectory and parse the returned string according to your requirement.
if you mean that you want an executable to determine what directory it is working under at run time you can search the c++ help utility for the
function that gets the working directory - the name escapes me right now
And here is an example
Code:CString CFoo::GetSystemDrive()
{
CString strSystemDrive;
::GetSystemDirectory(strSystemDrive.GetBufferSetLength(_MAX_PATH), _MAX_PATH);
strSystemDrive.ReleaseBuffer();
return strSystemDrive.Left(2);
}
Thanks