Kodi Community Forum

Full Version: Python - Code to get volume label of CD Drive in Windows?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've searched, and the python codes I found required dependencies and external modules. Is there any code that will do this without needing them?
Donwload my old ripper script for windows
http://luemmels-dvd-ripper.googlecode.co...x-0.6B.tar
Inside the windows folder is a batch file called volname.cmd that do exactly what you need.
Regards Hans
Haha, well I've written commands that do the exact same thing in batch format before, but I don't like dealing with trying to hide the command prompt window and everything, I'd like to keep it all in-house.
No dice outside of using batch files? Huh
It seems like this would work:

http://vermeulen.ca/python-win32api.html

Quote:If you need to get the volume label, or some other information about each of these drives you can use the GetVolumeInformation function, like:

t = win32api.GetVolumeInformation("C:\\")

This returns a tupple like:

('MDATA', -590490522, 255, 6, 'FAT32')