Jump to content

USB serial number,and vendor


Recommended Posts

I want to obtain USB serial number (Not Drivegetserial) and vendor id.

there is a program called "usbdeview" takes serialnumber of usb mass storages.

is there any way to obtain like this porgram.

I searched the all of forum,but I didnt find.

Not drive get serial because if I format usb mass storage this serial will change.I want to obtain serial number which is cant change with any format.

Thanks all...

Link to comment
Share on other sites

...The question as you state it does not really relate to autoit yet.

Hum well here's the google search for you I guess-

http://forums.microsoft.com/MSDN/ShowPost....25&SiteID=1

http://home.hot.rr.com/graye/Articles/USB_SerialNumbers.htm

http://www.codeproject.com/KB/cs/hard_disk_serialno.aspx

Have fun.

Also- DriveGetSerial() might work jsut as well :)

Edited by evilertoaster
Link to comment
Share on other sites

thank you but my code is here;(not all is mine)

may be fix this

Dim $var

dim $serial

$strComputer = "."

$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\cimv2")

$colEvents = $objWMIService.ExecNotificationQuery _

("Select * From __InstanceOperationEvent Within 5 Where " _

& "TargetInstance isa 'Win32_LogicalDisk' and " _

& "TargetInstance.DriveType = 2" )

While 1

$objEvent = $colEvents.NextEvent

$var= $objEvent.TargetInstance.DeviceId

$serial= DriveGetSerial( & $var "\" ) ;I dont want drivegetserial because it can be change

If $serial= 1224475543 Then ;This is volume serial number of my Usb and it can be change with format:

MsgBox(4096,"Test","right usb",10)

ElseIf $serial <> 1224475543 Then

MsgBox(4096,"Test","wrong usb",10)

EndIf

WEnd

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...