Welcome! Log In Create A New Profile

Advanced

Re: Unique ID of an external HDD

Posted by sivakrith 
Re: Unique ID of an external HDD
November 29, 2020 02:37AM
Hello,

Is there any unique Id of an external HDD, like the one available for Pen drives, that won't change even if formatted ? I want to restrict the usaage of windev application to be used only from a particular external HDD only. Any solution ?

Happiness Always
BKR Sivaprakash
Re: Unique ID of an external HDD
December 08, 2020 07:18AM
Hello,

If it could not be done with Windev, is there any tool / ActiveX (free / paid) to read unique ID (like Manufacturer serial no ) of an external HDD ?

Happiness Always
BKR Sivaprakash
Re: Unique ID of an external HDD
December 08, 2020 02:10PM
Hi, of course, it can be done with WINDEV. Look for USB functions. No time now, but I'll post an example ...

Kind regards,
Guenter Predl
office@windev.at
Re: Unique ID of an external HDD
December 08, 2020 03:07PM
Hello,

Try google "wmic get disk drive serial number"
Re: Unique ID of an external HDD
December 09, 2020 07:56AM
Hi, here's an example:

www.syspredl.com/datafiles/USB_Drive.zip

Kind regards,
Guenter Predl
office@windev.at
Re: Unique ID of an external HDD
December 09, 2020 02:20PM
Thanks Guenter,

I already tried with USB function, but no success. It returns the serial number of pendrives, not external / internal hdd. Nevertheless I'll check with your code too.

Marijan,
Tried with wmic get disk drive serial number. It returns internal hdd's serial number, not of external one. I get an error 'invalid xml format' when I attach an external hdd. Tried with powershell, where I got a junk like character in serial number column.
Re: Unique ID of an external HDD
December 09, 2020 05:12PM
Please type this in CMD:

wmic diskdrive>disk.txt

then open disk.txt in wordpad (without linewrap option)

I get all serials, internal, external, USB..., (except memory cards)

D:\>wmic diskdrive get model,serialnumber >d2.txt

D:\>TYPE D2.TXT
Model                           SerialNumber
HGST HTS725050A7E630            RC250FCB1RB88K
TOSHIBA MQ01ABD100 USB Device   1310080000052162
Verbatim STORE N GO USB Device  0E7401080
SDHC Card



Edited 3 time(s). Last edit at 12/09/2020 05:22PM by Marijan Tomasic.
Re: Unique ID of an external HDD
December 10, 2020 08:33AM
Thanks Marijan

Seems the hdd (Thoshiba) that I tried is not working as expected. I tried with another external hdd (WD), it works perfectly. Not sure why it returns junk characters for the first (Thosiba) hdd.

Thanks again.
Re: Unique ID of an external HDD
December 11, 2020 12:13PM
Current result

Tried with 2 hdd (Toshiba and WD).

Toshiba - returns junk in Win 7 and returns (correct) serial number in Win 10.
WD - returns (correct) serial number in both Win 7 and Win 10.

Seems there is an issue in Win 7, which was fixed in Win 10. Since Win 7 is not under active maintenance, we could not get the fix, any more, it seems.

[support.microsoft.com]
Re: Unique ID of an external HDD
December 12, 2020 05:50AM
Guenter

www.syspredl.com/datafiles/USB_Drive.zip

Got a different result when tried with the above code.

Toshiba - Returned the same serial number as returned by wmic in Win 10. In Win 7, wmic returned a junk character.
WD - returned a different serial number from the one returned by wmic in both Win 7 and Win 10. wmic returned the same serial number in both win 7 and win 10.

When we get two different serial numbers, which one could be the manufacturer's serial number for WD hdd ?

Happiness Always
BKR Sivaprakash
Re: Unique ID of an external HDD
January 02, 2021 11:00AM
Guenter,

www.syspredl.com/datafiles/USB_Drive.zip

The above tool is not listing connected external SSD harddisk and lists only non-ssd and pendrives in Win 10.
In Win 7 it list external ssd hdd.

Don't know why external ssd hdd doesn't appear in Win 10. Any idea ?

Happiness Always
BKR Sivaprakash
Re: Unique ID of an external HDD
January 02, 2021 04:54PM
Hi sivakrith,

this small program ist just using WLanguage commands! I simply don't know why they don't work verywhere. You could compare results with a tool like Nirsoft's USBDeview https://www.nirsoft.net/utils/usb_devices_view.html Btw, are you an administrator on that PC?? Being a simple user will be a problem. This one is for users too: [libusb.info]

More about devices connected to your PC: [www.techrepublic.com]

[docs.microsoft.com]

Kind regards,
Guenter Predl
office@windev.at
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: