how can i find out all of the drives that a user has, in C++, without using any API's (i mean without having to use a win32 text box or something....)
searched msdn, but didn't find much
how can i find out all of the drives that a user has, in C++, without using any API's (i mean without having to use a win32 text box or something....)
searched msdn, but didn't find much
You could try something like this.
Code:#include <windows.h> #include <stdio.h> int main() { char drive[] = "c:"; char i; UINT rc; for(i='c'; i <= 'z'; i++) { drive[0] = i; rc = GetDriveType( drive ); switch(rc) { case DRIVE_UNKNOWN: break; case DRIVE_FIXED: printf("%s - FIXED\n", drive); break; case DRIVE_REMOTE: break; case DRIVE_CDROM: printf("%s - CDROM\n", drive); break; case DRIVE_RAMDISK: break; case DRIVE_REMOVABLE: break; } } return 0; }
GetLogicalDrives()
You can get additional info on the drive with GetVolumeInformation() along with GetDriveType().
gg