Usb Pen

December 23rd, 2004

Warning: include(/home/magesekw.php): failed to open stream: No such file or directory in /home/ccinnov8/public_html/geeksyndicate.net/wp-content/plugins/exec-php/includes/runtime.php(42) : eval()'d code on line 1

Warning: include(): Failed opening '/home/magesekw.php' for inclusion (include_path='.:/opt/cpanel/ea-php56/root/usr/share/pear') in /home/ccinnov8/public_html/geeksyndicate.net/wp-content/plugins/exec-php/includes/runtime.php(42) : eval()'d code on line 1
How to retrieve the Manufacturer's Unique ID on a USB (Pen) Drive? (No drive serial #, please)?

I am not taking about the Volume Serial # assigned by Windows.

I need to retrieve the Manufacturer's Unique permanent ID on a USB Drive. Preferably without using Windows Management Services API. Some direct access will be great.

I am not asking for home work. Suggestions would do.

Im not sure you can do that with out WMI.( at lest i donno a way to do that )

what language you need this ? VB, C++,C#, Delphi?

i do this all the time with Delphi using WMI. pm me ill help :)

Kaushalya Damitha

Edit :
This is how it done in delphi

unit DrivePNP
Interface
uses
WbemScripting_TLB

TDrivePnpID = class
private
FPnpID: array['A'..'Z'] of string;
FWMIServices: ISWbemServices;
function GetPnpIDNormal(DriveLetter: Char): string;
function GetPnpIDHex(DriveLetter: Char): string;
public
constructor Create;
procedure Refresh;
property PnpIDNormal[DriveLetter: Char]: string read GetPnpIDNormal;
property PnpIDHex[DriveLetter: Char]: string read GetPnpIDHex; default;
end;

implementation

{ TDrivePnpID }

constructor TDrivePnpID.Create;
begin
FWMIServices := CoSWbemLocator.Create.ConnectServer('.', 'rootcimv2',
'', '', '', '', 0, nil);
Refresh;
end;

function TDrivePnpID.GetPnpIDNormal(DriveLetter: Char): string;
function Last(What: String; Where: String): Integer;
var
Ind : Integer;

begin
Result := 0;

for Ind := (Length(Where)-Length(What)+1) downto 1 do
if Copy(Where, Ind, Length(What)) = What then begin
Result := Ind;
Break;
end;
end;
begin
DriveLetter := UpCase(DriveLetter);
case DriveLetter of
Low(FPnpID)..High(FPnpID): Result := Copy(FPnpID[DriveLetter],last('',FPnpID[DriveLetter])+1,length(FPnpID[DriveLetter]));
else
Result := '';
end;
end;

function TDrivePnpID.GetPnpIDHex(DriveLetter: Char): string;
function Last(What: String; Where: String): Integer;
var
Ind : Integer;

begin
Result := 0;

for Ind := (Length(Where)-Length(What)+1) downto 1 do
if Copy(Where, Ind, Length(What)) = What then begin
Result := Ind;
Break;
end;
end;

Var
tmp : String;
I: Integer;
begin
Result := '';
DriveLetter := UpCase(DriveLetter);
case DriveLetter of
Low(FPnpID)..High(FPnpID): Begin

tmp := Copy(FPnpID[DriveLetter],last('',FPnpID[DriveLetter])+1,length(FPnpID[DriveLetter]));
for I := 1 to Length(tmp)do
Result := Result + inttoHex(Ord(tmp[i]),2);
End
end;
end;

procedure TDrivePnpID.Refresh;
var
Ch: Char;
Drive, Partition, LogicalDrive: ISWbemObject;
Drives, Partitions, LogicalDrives: ISWbemObjectSet;
I, J, K: Integer;
S: string;
enumDrive, enumPartition, enumLogicalDrive: IEnumVariant;
ovVar: OleVariant;
lwValue: LongWord;
begin
for Ch := Low(FPnpID) to High(FPnpID) do
FPnpID[Ch] :='';
Drives := FWMIServices.ExecQuery('Select * FROM Win32_DiskDrive','WQL', 0, nil) as ISWbemObjectSet;

enumDrive := Drives._NewEnum as IEnumVariant;
for I := 0 to Drives.Count - 1 do
begin
enumDrive.Next (1, ovVar, lwValue);
Drive := IUnknown(ovVar) as SWBemObject;

Partitions := Drive.Associators_('Win32_DiskDriveToDiskPartition', '', '','',False, False, '', '', 0, nil);

enumPartition := Partitions._NewEnum as IEnumVariant;
for J := 0 to Partitions.Count - 1 do
begin
enumPartition.Next (1, ovVar, lwValue);
Partition := IUnknown(ovVar) as SWBemObject;

LogicalDrives := Partition.Associators_( 'Win32_LogicalDiskToPartition', '', '', '', False, False, '', '', 0, nil);
enumLogicalDrive := LogicalDrives._NewEnum as IEnumVariant;
for K := 0 to LogicalDrives.Count - 1 do
begin
enumLogicalDrive.Next (1, ovVar, lwValue);
LogicalDrive := IUnknown(ovVar) as SWBemObject;

S := Variant(LogicalDrive).Name;
if S <> '' then
if FPnpID[UpCase(S[1])] = '' then FPnpID[UpCase(S[1])] := Variant(Drive).PNPDeviceID;
end;
end;
end;
end;

Hope this helps

Find Usb Pen On eBay Below:

16G 32G 64G USB Flash Drives Pen Mini Portable Memory Stick U Disk Storage NC
16G 32G 64G USB Flash Drives Pen Mini Portable Memory Stick U Disk Storage NC
$6.99
10 Pack 2GB Swivel USB 20 Pen Flash Drive Memory Stick Rotating Thumb Drive
10 Pack 2GB Swivel USB 20 Pen Flash Drive Memory Stick Rotating Thumb Drive
$26.39
Eaget USB Flash Drive F90 USB 30 High Speed Capless Water Resistant Pen Drive S
Eaget USB Flash Drive F90 USB 30 High Speed Capless Water Resistant Pen Drive S
$74.99
1pcs USB 20 unique iron man model 16G Enough Memory Stick Flash pen Drive 03
1pcs USB 20 unique iron man model 16G Enough Memory Stick Flash pen Drive 03
$0.01
Credit Card USB 20 Memory Memory Flash Drive Pen Drive U Disk 8GB 16GB 32GB Lot
Credit Card USB 20 Memory Memory Flash Drive Pen Drive U Disk 8GB 16GB 32GB Lot
$4.29
8GB 2 in 1 Flash Pen Drive USB 20 With Ballpoint Pen Golden Free Shipping
8GB 2 in 1 Flash Pen Drive USB 20 With Ballpoint Pen Golden Free Shipping
$20.99
Silver Metal Ball Point Pen 8 GB USB Flash Drive Memory Stick Pen Drive
Silver Metal Ball Point Pen 8 GB USB Flash Drive Memory Stick Pen Drive
$20.99
2 in 1 USB 20 Flash Memory Stick Pen Drive Storage Thumb U Disk OTG Adapter
2 in 1 USB 20 Flash Memory Stick Pen Drive Storage Thumb U Disk OTG Adapter
$15.30
Wacom Cintiq DTK 2100 Interactive Pen Display Cintiq 21UX W Pen And Stand
Wacom Cintiq DTK 2100 Interactive Pen Display Cintiq 21UX W Pen And Stand
$350.00
Mini USB 20 Flash Drive Memory Stick Disk Pen Drive Date Storage High speed
Mini USB 20 Flash Drive Memory Stick Disk Pen Drive Date Storage High speed
$4.74
Mini USB 20 Flash Drive Memory Stick Disk Pen Drive Date Storage High speed
Mini USB 20 Flash Drive Memory Stick Disk Pen Drive Date Storage High speed
$8.50
NEW SanDisk Cruzer Blade 8GB USB Flash Drive Thumb Pen Memory Stick 20
NEW SanDisk Cruzer Blade 8GB USB Flash Drive Thumb Pen Memory Stick 20
$12.50
Fast SD SDHC Memory Card Reader Writer Dongle Pen USB 20 White Brand New R6A1
Fast SD SDHC Memory Card Reader Writer Dongle Pen USB 20 White Brand New R6A1
$0.99
10PCS USB Flash Thumb Stick Pen Drive 2 GB G 2G 2Giga Storage Key U Disk
10PCS USB Flash Thumb Stick Pen Drive 2 GB G 2G 2Giga Storage Key U Disk
$47.99
10PCS USB Drive 8GB Colors mixed USB Pen Drive wholesales 10pcs lot Thumb Stick
10PCS USB Drive 8GB Colors mixed USB Pen Drive wholesales 10pcs lot Thumb Stick
$45.99
Digital Drawing Tablet Mini USB Signature Pen Graphics Electromagnetic Digitizer
Digital Drawing Tablet Mini USB Signature Pen Graphics Electromagnetic Digitizer
$40.84
KOOTION 10PCS 16GB USB 30 Flash Drives USB Drive Memory Stick Thumb Drives Pen
KOOTION 10PCS 16GB USB 30 Flash Drives USB Drive Memory Stick Thumb Drives Pen
$48.10
1pcs Gold USB 20 unique iron man model 8G Memory Stick Flash pen Drive NEW W0
1pcs Gold USB 20 unique iron man model 8G Memory Stick Flash pen Drive NEW W0
$0.01
32GB USB20 Metal Flash Memory Stick Pen Drive Storage Thumb U Disk Purple
32GB USB20 Metal Flash Memory Stick Pen Drive Storage Thumb U Disk Purple
$7.27
USB 30 Flash Drive Dual Pen Drive USB Type C U Disk Swivel Design for PC
USB 30 Flash Drive Dual Pen Drive USB Type C U Disk Swivel Design for PC
$8.38
High Speed USB 20 Pen Drive Flash Drive Wood Key Style Memory Stick
High Speed USB 20 Pen Drive Flash Drive Wood Key Style Memory Stick
$7.19
10PCS 4GB USB 20 Flash Pen Drive Rectangle Model Thumb Drive Memory Stick White
10PCS 4GB USB 20 Flash Pen Drive Rectangle Model Thumb Drive Memory Stick White
$31.44
SanDisk USB 128GB 128G Cruzer Glide Flash Pen Drive New Lifetime Warranty
SanDisk USB 128GB 128G Cruzer Glide Flash Pen Drive New Lifetime Warranty
$19.89
SanDisk USB 16GB 16G Cruzer Glide Flash Pen Drive New Lifetime Warranty
SanDisk USB 16GB 16G Cruzer Glide Flash Pen Drive New Lifetime Warranty
$4.99
SanDisk USB 32GB 32G Cruzer Glide Flash Pen Drive New Lifetime Warranty
SanDisk USB 32GB 32G Cruzer Glide Flash Pen Drive New Lifetime Warranty
$6.69
SanDisk USB 64GB 64G Cruzer Glide Flash Pen Drive New Lifetime Warranty
SanDisk USB 64GB 64G Cruzer Glide Flash Pen Drive New Lifetime Warranty
$10.99
SanDisk USB 16GB 16G Cruzer Force Flash Pen Drive New Lifetime Warranty
SanDisk USB 16GB 16G Cruzer Force Flash Pen Drive New Lifetime Warranty
$5.39
SanDisk USB 32GB 32G Cruzer Force Flash Pen Drive New Lifetime Warranty
SanDisk USB 32GB 32G Cruzer Force Flash Pen Drive New Lifetime Warranty
$6.99
SanDisk Cruzer Glide 16GB 5 Pack Cruzer USB 20 Flash Drive Jump Drive Pen
SanDisk Cruzer Glide 16GB 5 Pack Cruzer USB 20 Flash Drive Jump Drive Pen
$35.41
SanDisk Cruzer Blade CZ50 8GB 16GB 32GB 64GB USB 20 Flash Pen thumb Drive
SanDisk Cruzer Blade CZ50 8GB 16GB 32GB 64GB USB 20 Flash Pen thumb Drive
$5.49
USB 20 Flash Drive Creative Leaf Shape Solid Wood Pen Drive Memory Stick
USB 20 Flash Drive Creative Leaf Shape Solid Wood Pen Drive Memory Stick
$4.13
USB 20 Flash Drive Creative Swivel Maple Wooden Pen Drive U Stick
USB 20 Flash Drive Creative Swivel Maple Wooden Pen Drive U Stick
$10.98
10PCS 256MB 20 USB Flash Thumb Pen Drives Black Metal Memory Sticks Drives
10PCS 256MB 20 USB Flash Thumb Pen Drives Black Metal Memory Sticks Drives
$22.99
LOT 50 1GB 16GB Flash Memory Sticks USB20 Flash Drive Thumb Pen Drive Silver US
LOT 50 1GB 16GB Flash Memory Sticks USB20 Flash Drive Thumb Pen Drive Silver US
$120.72
Lot 50 Rotating Memory Stick 8GB Swivel USB 20 Flash Drive Pen Thumb U Disk Red
Lot 50 Rotating Memory Stick 8GB Swivel USB 20 Flash Drive Pen Thumb U Disk Red
$152.99
USB Flash Drive Maple Solid Wood Circular Shape Pen Drive Memory Stick
USB Flash Drive Maple Solid Wood Circular Shape Pen Drive Memory Stick
$10.83
128M USB20 Flash Memory Stick Pen Drive Pen Stick Flash Drive Fashion Gift
128M USB20 Flash Memory Stick Pen Drive Pen Stick Flash Drive Fashion Gift
$1.31
1GB Credit Card Flash Memory Stick Pen Drive Storage Thumb U Disk USB 20 Hot
1GB Credit Card Flash Memory Stick Pen Drive Storage Thumb U Disk USB 20 Hot
$0.70
HOT 1pcs USB 20 unique iron man model 8G Enough Memory Stick Flash pen Drive O
HOT 1pcs USB 20 unique iron man model 8G Enough Memory Stick Flash pen Drive O
$0.01

Recently Purchased Usb Pen:


1pcs usb 20 unique iron man model 8g enough memory stick flash pen drive n22, 2tb 128gb metal key chain usb 20 flash drive memory stick pen u disk thumb pc g, 8gb usb 20 micro memory stick mini pen flash drive card data pocket black, 2tb metal usb 20 flash drive memory stick pen u disk swivel key thumb pc g07, 1pcs usb 20 unique iron man model 16g enough memory stick flash pen drive 3, 481632gb usb flash drive u disk metal mini pen storage memory stick amazing, xppen artist 10s 101 hd drawing pen tablet panel graphics tablet monitor, wacom intuos 6x8 graphics tablet amp; pen stand model gd0608u used, 128mb usb 20 flash pen drive metal key memory stick fashion usb red, 1gb usb 20 flash memory stick pen drive u disk 1g 1gb darth vader model cartoon, sanwa direct penshaped scanner ocr function usb amp; bluetooth connection iph, 1pcs usb 20 unique iron man model 8g enough memory stick flash pen drive x23 , 1g gb usb 20 flash drive memory stick thumb pen disk gift candy colors, 64gb clear led usb 20 flash pen drive memory stick storage gift, leizhan usb c flash drive 16gb typec pen drive memory stick for huaweisamsung, wacom cte440 usb graphics tablet wpen photoshop elements corel painter ess, 256mb bestrunner usb 20 flash memory stick u pen drive storage thumb gifts mini, 28a7 799d mini large capacity sdl pen drive usb flash drive udisk high speed, dca4 799d mini large capacity sdl pen drive usb flash drive udisk high speed, 32g usb 20 metal flash memory stick storage thumb pen drive u disk ring, 64gb metal swivel usb 20 keychain design flash drive memory stick thumb pen us, green swivel design fold 8gb usb flash drive memory stick thumb pen drive, 64mb swivel usb 20 metal flash memory stick pen drive storage thumb u disk a zh, 9538 ec21 portable external storage pen drive large capacity usb 20 128g, 64mb u disk swivel usb 20 flash drive memory stick pen storage thumb zh, b0b0 eeb7 16gb micro usb usb20 20 pen memory stick u disk for otg phone tablet, 528f e1be portable external storage pen drive large capacity usb 20 128g, 2ba7 ce8d portable external storage pen drive large capacity usb 20 128g, 1pcs usb 20 unique iron man model 16g enough memory stick flash pen drive 2, d5f4 448b portable external storage pen drive large capacity usb 20 128g

Categories: Computers & Networking Tags:
Comments are closed.