//*************************************************************** // 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 sets the volume label for drive C. //*************************************************************** // drvsvl.cpp #include #include void main() { BOOL success; char volumeName[MAX_PATH]; cout << "Enter new volume label for drive C: "; cin >> volumeName; success = SetVolumeLabel("c:\\", volumeName); if (success) cout << "success\n"; else cout << "Error code: " << GetLastError() << endl; }