|
-
March 7th, 2009, 01:51 AM
#1
System Drive Path.
Hi all,
please tell me how can i get system drive path.
thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
-
March 7th, 2009, 07:01 AM
#2
-
March 7th, 2009, 09:06 PM
#3
Re: System Drive Path.
You either want the system drive or the system path!!!
Use GetWindowsDirectory or GetSystemDirectory and parse the returned string according to your requirement.
-
March 7th, 2009, 09:58 PM
#4
Re: System Drive Path.
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
-
March 8th, 2009, 03:50 AM
#5
Re: System Drive Path.
 Originally Posted by jim enright
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
Before searching in the help system just note that system directory (asked by OP) is not the same as the application working directory which you are suggesting to find.
-
March 8th, 2009, 04:00 AM
#6
Re: System Drive Path.
And here is an example
Code:
CString CFoo::GetSystemDrive()
{
CString strSystemDrive;
::GetSystemDirectory(strSystemDrive.GetBufferSetLength(_MAX_PATH), _MAX_PATH);
strSystemDrive.ReleaseBuffer();
return strSystemDrive.Left(2);
}
-
March 9th, 2009, 12:21 AM
#7
Re: System Drive Path.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|