Computing.Net > Forums > Programming > locating windows default drive

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

locating windows default drive

Reply to Message Icon

Name: secrets
Date: October 14, 2004 at 05:27:53 Pacific
OS: WINDOWS
CPU/Ram: 1.7
Comment:

how to get the default drive and dir of windows in vb and vc?



Sponsored Link
Ads by Google

Response Number 1
Name: BlueRaja
Date: October 14, 2004 at 13:34:01 Pacific
Reply:

Easiest way would be to call the system:
system("echo %WINDIR%");

AKhalifman@hotmail.com


0

Response Number 2
Name: secrets
Date: October 14, 2004 at 18:43:29 Pacific
Reply:

any other solution?


0

Response Number 3
Name: waterdog
Date: October 15, 2004 at 07:41:31 Pacific
Reply:

The functions GetWindowsDirectory, GetSystemDirectory and GetCurrentDirectory when sent a pointer to a buffer and the size of the buffer can be used to get the directory's indicated in the function names. The drive letter is the first character in the buffer string.

When using GetCurrentDirectory the pointer to a buffer is the last parameter while it is the first parameter in the other two.

They all return the number of characters written to the buffer.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: locating windows default drive

Setting up a usb 2.0 flash drive www.computing.net/answers/programming/setting-up-a-usb-20-flash-drive/16442.html

Show hardware list using batch www.computing.net/answers/programming/show-hardware-list-using-batch/17412.html

batch coding www.computing.net/answers/programming/batch-coding/18715.html