I need to know how to get the hard disk serial number, in windows.
Thank you in advance.
I googled "hard disk serial number python" and came up with something that did this:
import win32api print win32api.GetVolumeInformation("C:\\")
It prints out a number of things like the file system and name, im not sure if it has the serial number but thats what other people on the python mailing list thought that it might be. So give it a shot. For this you need the Mark Hammond modules for windows. That includes the win32api
Hope that helps. If not have a bit of a google yourself. :) Just to check
To follow up on the paulthom12345 information:
""" win32api.GetVolumeInformation(path) returns tuple containing ... string - name of volume/disk/drive long - serial number of volume/disk/drive long - maximum component length of a file name long - flags specific to the file system string - file system name """ import win32api path = "C:/" info = win32api.GetVolumeInformation(path) print( "disk serial number = %d" % info ) """ my output on Vista machine --> disk serial number = 1022625589 """
This is a quick little hack I made for windows that works on my vista computer, no third party modules needed ;-)
import os data = os.popen('vol '+'c:', 'r').read() data = data.split() return data[len(data)-1:]
I looked around quick on the web and on linux you might be able to cook up something like that using the shell command "hdparm".
Help! I want to create a java program that finds the highest even integer among the values entered by the user. Stop asking values when a value less than 1 have been entered. If no even integer is entered, display "No Even Integer"
Here is the sample output that I ...
Hello All ...
Iam Getting An Error With try to excecute the stored procedure .
I have Have Sql database , the stored procedure like so :
USE [MPRS] GO /****** Object: StoredProcedure [dbo].[Search_Licenses_By_Number] Script Date: 26-Nov-16 8:06:52 AM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE ...
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...