Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

detecting a name on a drive 1

Status
Not open for further replies.

bdowen

Programmer
Jun 10, 2003
12
US
Is there a way to detect a name on a drive. For instance if I named my c:\ drive "Local Disk" is there a way to detect or decifer this name.

Thanks for the help!!!
 
Code:
>>> for driveletter in win32api.GetLogicalDriveStrings().split('\x00'):
... 	try:
... 		print win32api.GetVolumeInformation(driveletter), driveletter
... 	except Exception, e:
... 		print e, driveletter
... 
(21, 'GetVolumeInformation', 'The device is not ready.') A:('WIN98SYSTEM', 304156420, 255, 6, 'FAT32') C:('WINXPSYSTEM', 991825671, 255, 6, 'FAT32') D:('DATA', 305926101, 255, 6, 'FAT32') E:('justin', -271533306, 110, 524293, 'CDFS') F:(3, 'GetVolumeInformation', 'The system cannot find the path specified.') 
>>>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top