Tony Cappellini wrote:
>>Tim Golden has a way to do just about everything, but this particular
>>snippet has nothing to do with the original question.
def get_unique_id (hFile):
(
attributes,
created_at, accessed_at, written_at,
volume,
file_hi, file_lo,
n_links,
index
>>Tim Golden has a way to do just about everything, but this particular
>>snippet has nothing to do with the original question.
def get_unique_id (hFile):
(
attributes,
created_at, accessed_at, written_at,
volume,
file_hi, file_lo,
n_links,
index_hi, index_lo
) = win32f
0 + v )
print UnsignedHex( win32api.GetVolumeInformation('C:\\')[1] )
Thanks again to everyone for your help.
-Kyle Rickey
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Tim Golden
Sent: Friday, May 16, 2008 12:45 PM
Cc: python-win32@python.org
Rickey, Kyle W wrote:
How do I get the volume serial number for a drive? For example in the
cmd prompt issuing this:
WMI to the rescue?
import wmi
for volume in wmi.WMI ().Win32_LogicalDisk ():
print volume.Caption, "=>", volume.VolumeSerialNumber
TJG
___
Tony Cappellini wrote:
>>How do I get the volume serial number for a drive? For example
in the
>>cmd prompt issuing this:
It looks like Tim Golden has a way to do what you want- via Python!
http://tgolden.sc.sabren.com/python/win32_how_do_i/see_if_two_files_are_the_same_file.html
Message: 5
> Date: Fri, 16 May 2008 10:35:45 -0500
> From: "Rickey, Kyle W" <[EMAIL PROTECTED]>
> Subject: [python-win32] Volume Serial Number
> To:
> Message-ID:
><[EMAIL PROTECTED]
> >
> Content-Type: text/plain; charset="us-ascii"
Rickey, Kyle W wrote:
How do I get the volume serial number for a drive? For example in the
cmd prompt issuing this:
C:\>vol C:
Volume in drive C is LABEL
Volume Serial Number is -
Is the volume serial number wrapped by pywin32? I found the function
win32api.GetVolumeInfo
That's not the serial number of the drive- as assigned by the drive
manufacturer.
If you want the SN from the drive manufacturer, you will need to issue an
IOCTL ATA Passthrough command which sends the ATA Identify Device command
to the drive. Unless the Winapi has a wrapper for that functionalit
Dahlstrom, Roger wrote:
only way I know how to do it is
import os
out = os.popen("dir SomethingThatDoesntExist")
print out
The "vol" command was designed for this purpose:
out = os.popen("vol")
although GetVolumeInformation is a better way.
--
Tim Roberts, [EMAIL PROTECTED]
Providenza &
t: [python-win32] Volume Serial Number
How do I get the volume serial number for a drive? For example in the cmd
prompt issuing this:
C:\>vol C:
Volume in drive C is LABEL
Volume Serial Number is -
Is the volume serial number wrapped by pywin32? I found
How do I get the volume serial number for a drive? For example in the
cmd prompt issuing this:
C:\>vol C:
Volume in drive C is LABEL
Volume Serial Number is -
Is the volume serial number wrapped by pywin32? I found the function
win32api.GetVolumeInformation, but it doesn't seem
11 matches
Mail list logo