The declares for Windows that would result in a Manufacturer Supplied Serial Number for a USB device that was properly configured by that MF is:
(VB)
Declare Function HidD_GetSerialNumberString Lib "HID.dll" (ByVal Handle&, ByVal
BufferPtr&, ByVal Length&) As Long
(RB)
I don't have RB to test but my guess at RB declare is
Declare Function HidD_GetSerialNumberString Lib "HID.dll" ( Handle As Integer, BufferPtr As Integer, Length As Integer ) As Integer

(I hope the bv/br parts are correct)

However, I'd suggest that you consider expanding your requirement to include:
being notified if your DEVICE is available, etc.
This would include knowing such things as:
Device Notifications
and registering your application to receive them.

See here:
Device Notifications in Detail (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devio/base/device_notifications.asp) DEV_BROADCAST_HDR and DEV_BROADCAST_DEVICEINTERFACE (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devio/base/dev_broadcast_hdr_str.asp) RegisterDeviceNotification (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devio/base/registerdevicenotification.asp)

For the mac, this link would be one start:
http://rashkovskii.com/articles/2006/11/05/macosx-usb-stick-info-snippet

Doesn't have notifications, etc. But seems to be similar to your Shell in your OP.

Anyhoo, .*.


====================OP
Message: 6
Subject: Re: Get a USB-drives serialnumber (VB-code for Win, ? for
        Mac)
From: Chris Henkel <[EMAIL PROTECTED]>
Date: Wed, 24 Jan 2007 18:19:18 +0100

OP:I would like to read the serial-number of a USB memory-stick
programmatically;...

For the Mac I have only found to ask the shell to pass back the serial
number: ioreg -c IOUSBDevice | grep "USB Serial Number

_________________________________________________________________
Invite your Hotmail contacts to join your friends list with Windows Live Spaces http://clk.atdmt.com/MSN/go/msnnkwsp0070000001msn/direct/01/?href=http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to