Menu
The 'Volume' serial number is created when you format a drive, and it can be changed without reformatting, although in practice people rarely do so. I thought it might be a good experiment to try and do this using the native Windows API 'GetVolumeInformation' instead, which requires P/Invoke, in C#. Jul 8, 2016 - Hi Experts, I'm trying to use the Windows API function GetVolumeInformation located in kernel32 to read the Volume Serial Number for drive C.
(Windows) Use this VI to retrieve descriptive information, including the serial number, file system, and volume name, for hard drives or disk drives. This VI uses the Call Library Function Node to call the GetVolumeInformation function.
Refer to the Microsoft Developer Network Web site at www.msdn.microsoft.com for more information about the GetVolumeInformation function. Note: LabVIEW might prompt you to open the kernel32 DLL when you open this VI.
You can find the kernel32 DLL in the WINDOWS SYSTEM32 directory. On the block diagram, double-click the Call Library Function Node and click the Browse button to navigate to the correct DLL.
Windows 10, Python 3.6. I want to get the serial number of the drives (without external modules like Win32 or WMI). It is needed for identification of removable devices (like USB external drives). Eryk, your solution is the best solution for me: os.stat(drive).stdev I don't need the real ID.
I write a Recycle Bin manager in Python - for my machine only. It just simply registers all rec.
![Number Number](/uploads/1/2/5/4/125451486/750926693.png)
Bin files to an SQLite DB (only the new ones with a date). After 30 days it deletes too old registered recycle bin files. Without the serial the external drives make more records for one file (E:, F:, G: ). And because of different drives I may search in wrong drive (on deletion process the registered E.
X.dcu is on G:., so I can't find it). But with this code is I can substitute the drive + RecBin folder with the serial, and later I can search it in good drive.