Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Usb Flash Drive's Serial Number

Status
Not open for further replies.

newtofoxpro

Programmer
Sep 16, 2007
301
IN
How can I get Mfg. Serial Number for Usb Flash Drive for fpw2.6 I got some coding for Visual foxpro but i unable to convert to fpw2.6

oWMi = getobject("winmgmts://")
col = oWMI.ExecQuery("Select * from win32_diskdrive")
for each disk in col
? disk.PNPDeviceID
next

Thank you in advance
 
newtofoxpro,
only for inspiration from 2.0 (DOS):

proc say_vol_usb
crea table disk_vol (text C(80))
use disk_vol
on error ok = .F.
for ii = 67 to 90
disk = chr(ii)
ok = .T.
cluster = sys(2022,"&disk")
if ok
!dir &disk.: > disk_vol.txt
zap
appe from disk_vol.txt type sdf
if recc() > 0
go top
skip
if right(trim(text),10) = "USB MEMORY"
? text
skip
? text
* exit && to find only first USB
endif
endif
endif
endfor
use
on error
retu

Tesar
 
Many Many Thanks,
I require the Serial Number of Flash Drive which should not change after format. Above code is for Volume Serial Number which may be change with format or without format.

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top