//*************************************************************** // From the book "Win32 System Services: The Heart of Windows 98 // and Windows 2000" // by Marshall Brain // Published by Prentice Hall // // Copyright 1995, by Prentice Hall. // // This code gets the in-use logical drive letters. //*************************************************************** // drvgld.cpp #include #include void main() { DWORD drives; int x; drives = GetLogicalDrives(); cout << "Logical drives on this machine: "; for (x=0; x<26; x++) { if (drives & 1!=0) cout << (char) ('A'+x) << ' '; drives = drives >> 1; } cout << endl; }