DWORD Serial; DWORD Length; GetVolumeInformation("D:",NULL, MAX_PATH,&Serial,&Length, NULL,NULL,MAX_PATH); CString StrSerial; StrSerial.Format("%ud",Serial); CFile logfile(_T("DiskID.log"), CFile::modeWrite|CFile::modeCreate); logfile.Write(StrSerial,StrSerial.GetLength()); logfile.Flush(); logfile.Close();