If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Rate Thread | Display Modes |
#31
|
|||
|
|||
SSDs serial No in BIOS.
Yep, that works (provided the drive letter is entered in upper case) Fixed... Dim oWMI, Path, vData, vInfo, sInfo, i, iNdx, bSelectedPath Set oWMI = GetObject("WinMgmts:") Path = UCase(InputBox("Enter the Drive Letter")) Set vData = oWMI.ExecQuery("Select * from Win32_LogicalDisk Where DriveType = 3") i = 0: Path = Left(Path, 1) & ":" For Each vInfo In vData 'Assign an index only if the USB DeviceID matches Path. If vInfo.DeviceID = Path Then iNdx = i: bSelectedPath = True: Exit For i = i + 1 Next If bSelectedPath Then 'Iterate the WMI.Win32_DiskDrive class to verify Path is a valid USB device, 'and determine an index for identifying our target USB device. Set vData = oWMI.ExecQuery("Select * from Win32_DiskDrive") i = 0 For Each vInfo In vData If UCase(vInfo.InterfaceType) = "IDE" Then If i = iNdx Then sInfo = Path & " SerialNumber: " & vInfo.SerialNumber: Exit For i = i + 1 End If Next End If Wscript.Echo sInfo -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
Ads |
#32
|
|||
|
|||
SSDs serial No in BIOS.
Peter Jason wrote:
On Sun, 18 Mar 2018 15:44:01 +1100, Peter Jason wrote: I've just cloned my System SSD to a new one because of the endless "run CHKDSK" flags in the RHS notification panel. I bought the same brand & size as the old one, a "Samsunh 850 EVO". In the BIOS there seems to be no way to tell these apart, no serial numbers or other properties. How is one to tell them apart? I had to go to disk management and see which had the "offline" disabled, then shutting down and unplugging the old SSD & starting all up again. All seems well now; but we'll see. I have 3 WD 500's clones that I bought about the same time. I wrote part of the s/n's and vol info on the cases where I can see it from the open side of the comp. Two are live disks at any one time. But that still does not tell me which disk is C or D (or E) so I end up plugging in one at a time after cloning to get vol/sn. Then I put a text file on that desktop that is named C (or D,E) and last 4 digits of the vol ID, etc. Then I use the bios to set boot order. |
#33
|
|||
|
|||
SSDs serial No in BIOS.
GS wrote:
Andy Burns wrote: Mayayana wrote: What I'm saying is that you are both using WMI. You may not know it Of course I know it, the clue is in the name; I was complaining about *WHAT* was being retrieved, rather than *HOW* The two drives can be told apart, by their Power-On-Hours field in SMART. One drive claims to be brand new. The POH should have a low numerical value. While you're reviewing the POH in HTTune SMART tab, you can flip to the Info tab and review SerialNumber. And HDTune disks should be in the same order as Disk Management. Using WMIC and PhysicalDisk versus SerialNumber, should show the same pattern. Paul What Namespace contains 'PhysicalDisk'? (Not in CIMV2, which is what I'm using) Powershell (Win10 Insider at the moment) PS C:\WINDOWS\system32 gwmi -namespace "root" -class "__Namespace" | Select Name Name ---- subscription DEFAULT CIMV2 msdtc Cli SECURITY SecurityCenter2 RSOP PEH StandardCimv2 WMI directory Policy Interop Hardware ServiceModel SecurityCenter Microsoft Appv ******* Command Prompt (fuller syntax) C:\WINDOWS\system32wmic /namespace:cimv2 diskdrive get model,name,serialnumber Model Name SerialNumber \\.\PHYSICALDRIVE1 WDC WD5003AZEX-00K0CA4 \\.\PHYSICALDRIVE0 WD-WCC6Z0VE1234 ******* From this web page, "diskdrive" appears to be an alias for Win32_DiskDrive https://www.1e.com/blogs/2009/09/23/...class-mapping/ DISKDRIVE Select * from Win32_DiskDrive Paul |
#34
|
|||
|
|||
SSDs serial No in BIOS.
Mayayana wrote:
"GS" wrote | What I posted was the Win32_DiskDrive equivalent of | Garry's code. Win32_DiskDrive has a SerialNumber property. | What I posted was just the scripted, direct-from-WMI | version of your method. *It's all coming from the same | place.* (Note that DeviceID also returns a | unique value: The order of the disk as the system | sees it: disk 0, disk 1, etc.) | | None of that matters if the return doesn't associate the serial# with its | respective drive, which Andy's cmd line approach doesn't do. See my last reply | for a better solution... I'm not sure that's better. Peter seemed to be saying that one disk was not mounted. Of course. Two disks with a certain *identical* numeric identifier, cause Disk Management to place the second discovered instance in "Offline" state. This is referred to in sports, as "own goal", where you shoot on your own net. (Been there, and done that :-) ) If you clone a drive with "dd.exe" or "gddrescue", then be aware you're shooting on your own goal. These utilities make too exact of a copy. A true clone is a bit on the useless side. Modern third-party cloning software knows this, and changes that identifier so there will not be a conflict. ******* When Macrium Reflect (and 20 other softwares) make clones, they are careful to modify the critical identifier, such that, not only doesn't boot become confused, the two drives also mount because no "conflict" is detected by Disk Management. The result looks like this. Critical Identifier BACKUP (E WINDOW10 (C SYSTEM_RESERVED 1234 Critical Identifier BACKUP (F WINDOW10 (G SYSTEM_RESERVED 5678 There are a number of identifiers that Disk Management "tolerates". There is one identifier, which it does not tolerate. Critical Identifier BACKUP (E WINDOW10 (C SYSTEM_RESERVED 1234 Critical Identifier /// /// /// ("Offline") 1234 Now, I can't work on the second hard drive, until I resolve the issue. I don't know all the identifiers well enough to give a lecture. The scary part, is the GUIDs we see as being an aspect of BCD and bcdedit, may actually be stored in the registry, and not be "stamped" on the disk as such. I have a suspicion, if we knew how things really worked, we'd be scared out of our wits. (The boot sequence may have to "probe" a bunch of stuff, before it can boot!) I tried one day, from the Linux side, to find these "identifiers", and one always eluded me. The Linux numerics always seem to be shorter than the one I'm looking for (a VSN might be 8 hex digits, OK). My conclusion from the exercise, is the info is not stored in MBR, GPT, PBR, but instead is crazily stored in a registry. I had always thought GUID was some sort of primary identifier I would find in a file system header. It doesn't seem to be the case, but I've not seen an article that lays it all out either. Or I'd quote that instead. By all means, use gddrescue to emergency clone a hard drive. But don't expect (necessarily) that both drives will remain in online state, if plugged in together. The Macrium Emergency Boot CD is capable of randomly assigning new GUIDs to fix a boot issue. You could for example, plug in the new drive, and give that a try. Then plug in the old drive, and see if anything is offline. I've not tried this experiment. You could probably do this in a few minutes, in a VM. ******* Summary: All I can tell you right now, is if you make two disks "identical enough", one will go offline on you. And refuse to go online, when given the command. HTH, Paul |
#35
|
|||
|
|||
SSDs serial No in BIOS.
Ok, so there is no class named PhysicalDisk, they are just referring to
Win32_DiskDrive as "Physical Disk Manager" DiskDrive returns the hardware SerialNumber; LogicalDrive returns the VolumeSerialNumber and the path as Caption or DeviceID; The indexes each use match drive for drive, so matching a DriveLetter in LogicalDrive gives you the index of that drive. Matching the index in DiskDrive gets the hardware SerialNumber for the drive labelled as the specified DriveLetter. -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
#36
|
|||
|
|||
SSDs serial No in BIOS.
On 03/18/2018 8:32 AM, Sjouke Burry wrote:
On 18-3-2018 5:53, Bob_S wrote: "Peter Jason"Â* wrote in message ... I've not seen the serial number in a legacy BIOS but under the Boot menu, it will list the model.Â* If it's a UEFI or hybrid UEFI/BIOS then it just may be listed in there.Â* But if your are just trying to get the serial number to avoid tearing the system down, there are a number of free programs such as Speccy from Piriform ( https://www.ccleaner.com/speccy/download ). Hey, thats a nice program,(speccy), even works on xp. Yes Speccy sure gives you a ton and a half of good info, Indispensable for me, I have used it for ages. Rene |
#37
|
|||
|
|||
SSDs serial No in BIOS.
"Paul" wrote
| From this web page, "diskdrive" appears to be an alias for Win32_DiskDrive | Yes. There are various aliases that are essentially shortcuts to a block of code. One can call wmic, pass such an alias, and wmic will handle the actual code required to make the call. In briefly researching this (I hadn't been aware of wmic) I also came across MSFT_PhysicalDisk. It seems to be new as of Win8 and appears to be the same as Win32_DiskDrive. What a mess! Oddly, I never came across any clear docs about such wmic keywords/aliases. They only advise using the command line to get a list. The nice thing about something like wmic is that one can find a single line to get info, without needing to deal with code. On the downside, that leaves one crippled. Without asking WMI directly there's little ability or knowledge to adapt the query. One is pretty much limited to whatever commands are being shared online. |
#38
|
|||
|
|||
SSDs serial No in BIOS.
"Paul" wrote
| From this web page, "diskdrive" appears to be an alias for Win32_DiskDrive | Another note that some may find of interest.... The entire WMI documentation is available, but requires a bit of work to get. (As far as I can tell, there's no wmic doc.) In case anyone would like the WMI help file and doesn't have it (it's actually quite good), here are instructions. These docs used to be available as small downloads of CHM files in specific, small SDK packages, but those have been taken offline. These days the only docs are in the full, gigantic, Windows SDK, which is all the tools/docs developers might want. The help is packaged as HXS files, which are essentially a corrupt version of CHM and require a special reader. But it is possible to circumvent the obstacles and get normal help files for any topic. 1) This link should work to get the real ISO of the Win7 SDK rather than a nonsense "web installer" link: https://download.microsoft.com/downl...SDK_EN_DVD.iso Otherwise, try this and make sure you get the X86 version: https://www.microsoft.com/en-us/down....aspx?id=18950 2) Open the ISO using 7-Zip. Inside the Setup\WinSDKDocWin32 folder, take out cab3.cab. Inside that, find and extract this file: WinSDK_WMISDK_hxs_A34BD9CE_F24B_474E_ACCA_47BD8490 8129_x86 3) Go here to get the HXS to CHM converter: https://www.jsware.net/jsware/hxs2chm.php5 (You'll also need to download Microsoft's free HTML Help Workshop.) 4) With that you can get yourself a WMI CHM reference that includes all methods, classes, etc. The HXS to CHM converter might require a bit of setup -- it needs the help workshop and 7-Zip paths to work -- but once set up the conversion is basically a 1-click operation. Anyone who wants other docs might want to convert the whole shebang: Extract all 6 CABs from the help folder and use the converter to convert them all to CHM in one shot. Then you get Windows Script Host, IE DOM, shell.... pretty much anything that MS has docs for -- which takes forever to look up online -- has a corresponding help file. With that you end up with full, accessible, local help, but without the gargantuan bloat of a full Windows SDK installation, and without the help files being limited in terms of how you can read them. All Windows versions support CHM help files as a native format. |
#39
|
|||
|
|||
SSDs serial No in BIOS.
Mayayana wrote:
"Paul" wrote | From this web page, "diskdrive" appears to be an alias for Win32_DiskDrive | Another note that some may find of interest.... The entire WMI documentation is available, but requires a bit of work to get. (As far as I can tell, there's no wmic doc.) In case anyone would like the WMI help file and doesn't have it (it's actually quite good), here are instructions. These docs used to be available as small downloads of CHM files in specific, small SDK packages, but those have been taken offline. These days the only docs are in the full, gigantic, Windows SDK, which is all the tools/docs developers might want. The help is packaged as HXS files, which are essentially a corrupt version of CHM and require a special reader. But it is possible to circumvent the obstacles and get normal help files for any topic. 1) This link should work to get the real ISO of the Win7 SDK rather than a nonsense "web installer" link: https://download.microsoft.com/downl...SDK_EN_DVD.iso Otherwise, try this and make sure you get the X86 version: https://www.microsoft.com/en-us/down....aspx?id=18950 2) Open the ISO using 7-Zip. Inside the Setup\WinSDKDocWin32 folder, take out cab3.cab. Inside that, find and extract this file: WinSDK_WMISDK_hxs_A34BD9CE_F24B_474E_ACCA_47BD8490 8129_x86 3) Go here to get the HXS to CHM converter: https://www.jsware.net/jsware/hxs2chm.php5 (You'll also need to download Microsoft's free HTML Help Workshop.) 4) With that you can get yourself a WMI CHM reference that includes all methods, classes, etc. The HXS to CHM converter might require a bit of setup -- it needs the help workshop and 7-Zip paths to work -- but once set up the conversion is basically a 1-click operation. Anyone who wants other docs might want to convert the whole shebang: Extract all 6 CABs from the help folder and use the converter to convert them all to CHM in one shot. Then you get Windows Script Host, IE DOM, shell.... pretty much anything that MS has docs for -- which takes forever to look up online -- has a corresponding help file. With that you end up with full, accessible, local help, but without the gargantuan bloat of a full Windows SDK installation, and without the help files being limited in terms of how you can read them. All Windows versions support CHM help files as a native format. G:\GRMSDK\GRMSDKX_EN_DVD__x64.iso\Setup\WinSDKDocW in32_amd64\cab3.cab\ WinSDK_WMISDK_hxs_A34BD9CE_F24B_474E_ACCA_47BD8490 8129_amd64 6,129,504 bytes G:\GRMSDK\GRMSDK_EN_DVD__32_bit.iso\Setup\WinSDKDo cWin32\cab3.cab\ WinSDK_WMISDK_hxs_A34BD9CE_F24B_474E_ACCA_47BD8490 8129_x86 6,129,504 bytes If you "Open Inside" with 7ZIP, there seem to be HTML files in there. Perhaps extracting those files would work ? Inside is a WMI folder, with a bunch of HTML. I have a few SDK DVDs here, but not a full set, and usually unlabeled as well. So I can't tell which one is for which OS :-) Paul |
#40
|
|||
|
|||
SSDs serial No in BIOS.
"Paul" wrote
| WinSDK_WMISDK_hxs_A34BD9CE_F24B_474E_ACCA_47BD8490 8129_x86 6,129,504 bytes | | If you "Open Inside" with 7ZIP, there seem to be HTML files in there. | | Perhaps extracting those files would work ? | You can if you want to, but there will be a number of problems. Some links won't work. You won't have a table of contents or index. The whole thing will be in hundreds of separate files rather than one organized CHM. | Inside is a WMI folder, with a bunch of HTML. | Yes. That's one thing 7-Zip is good for. It can extract from HXS and CHM files. See the technical details section near the bottom of https://www.jsware.net/jsware/hxs2chm.php5 HXS and CHM are very similar. Microsoft just changed it enough to break it. But they did do a thorough job of breaking it, nonetheless. And they keep breaking it, using inconsistent structure between HXS files. In both cases they're HTML files, images, TOC, index, etc, packed into a single file. But in order to get a CHM, the HXS needs to be unpacked, the pages edited, the links fixed, and a new TOC and index must be generated. Then the MS Help Workshop can be used to compile it all into a CHM. (The converter also allows for a few niceties, like adding custom CSS and removing script that can cause errors.) So, yes, you can extract the HTML and use it, but that's not advisable. It would be like using a broken version of Microsoft's online help. The advantage of a real help file is that it's all organized and indexed for quick access. (The HXS2CHM converter also puts search and a Favorites tab in all help files, both of which can be very handy. Oddly, many CHM help files have neither, yet it's just a simple parameter in compiling the CHM that makes the difference.) The HXS2CHM converter does have some extra scripts for setting up something like an MSDN help system. Basically it unpacks all the HXS files to folders, as you suggested, then generates a master index and sets that up as an HTA. I use that version sometimes when I need to look up something and don't know which CHM it's in. But it's a bit unwieldy. There's a single webpage for every page in every help file. The DHTML help alone is something like 28 MB. Just the help pages for HTML tags number 143 files. And that's just one among dozens of folders in the DHTML help, which is one among over 200 hundred folders in the total help docs. |
#41
|
|||
|
|||
SSDs serial No in BIOS.
Paul in Houston TX wrote:
Peter Jason wrote: On Sun, 18 Mar 2018 15:44:01 +1100, Peter Jason wrote: I've just cloned my System SSD to a new one because of the endless "run CHKDSK" flags in the RHS notification panel. I bought the same brand & size as the old one, a "Samsunh 850 EVO". In the BIOS there seems to be no way to tell these apart, no serial numbers or other properties. How is one to tell them apart? I had to go to disk management and see which had the "offline" disabled, then shutting down and unplugging the old SSD & starting all up again.Â* All seems well now; but we'll see. I have 3 WD 500's clones that I bought about the same time. I wrote part of the s/n's and vol info on the cases where I can see it from the open side of the comp.Â* Two are live disks at any one time. But that still does not tell me which disk is C or D (or E) so I end up plugging in one at a time after cloning to get vol/sn. Then I put a text file on that desktop that is named C (or D,E) and last 4 digits of the vol ID, etc. Then I use the bios to set boot order. Try Belarc, it's free Jim |
#42
|
|||
|
|||
SSDs serial No in BIOS.
On Sun, 18 Mar 2018 07:41:59 -0400, GS wrote:
On Sun, 18 Mar 2018 15:44:01 +1100, Peter Jason wrote: I've just cloned my System SSD to a new one because of the endless "run CHKDSK" flags in the RHS notification panel. I bought the same brand & size as the old one, a "Samsunh 850 EVO". In the BIOS there seems to be no way to tell these apart, no serial numbers or other properties. How is one to tell them apart? I had to go to disk management and see which had the "offline" disabled, then shutting down and unplugging the old SSD & starting all up again. All seems well now; but we'll see. Save this script to a file named "DiskDriveInfo.vbs", then double-click it to get info for every drive on your machine. strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") Set colItems = objWMIService.ExecQuery( _ "SELECT * FROM Win32_LogicalDisk",,48) For Each objItem in colItems Wscript.Echo "-----------------------------------" Wscript.Echo "Win32_LogicalDisk instance" Wscript.Echo "-----------------------------------" Wscript.Echo "Caption: " & objItem.Caption Wscript.Echo "Description: " & objItem.Description Wscript.Echo "VolumeSerialNumber: " & objItem.VolumeSerialNumber Next Thanks, I did copied this into Notebook, saved it as "DiskDriveInfo.vbs" but it did not list my 8 HDDs (some Bitlockered), but rather gave a series of texts. |
#43
|
|||
|
|||
SSDs serial No in BIOS.
So, yes, you can extract the HTML and use it,
but that's not advisable. It would be like using a broken version of Microsoft's online help. The advantage of a real help file is that it's all organized and indexed for quick access. (The HXS2CHM converter also puts search and a Favorites tab in all help files, both of which can be very handy. Oddly, many CHM help files have neither, yet it's just a simple parameter in compiling the CHM that makes the difference.) i suppose by browsing the HTMLs, one could streamline the content of a CHM to exclude some of the extraneous info they might not be interested to have in their WMI.chm. IOW, build their own custom wmi-quick-n-dirty manual that also includes personal script/code examples/samples. -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
#44
|
|||
|
|||
SSDs serial No in BIOS.
On Sun, 18 Mar 2018 07:41:59 -0400, GS wrote:
On Sun, 18 Mar 2018 15:44:01 +1100, Peter Jason wrote: I've just cloned my System SSD to a new one because of the endless "run CHKDSK" flags in the RHS notification panel. I bought the same brand & size as the old one, a "Samsunh 850 EVO". In the BIOS there seems to be no way to tell these apart, no serial numbers or other properties. How is one to tell them apart? I had to go to disk management and see which had the "offline" disabled, then shutting down and unplugging the old SSD & starting all up again. All seems well now; but we'll see. Save this script to a file named "DiskDriveInfo.vbs", then double-click it to get info for every drive on your machine. strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") Set colItems = objWMIService.ExecQuery( _ "SELECT * FROM Win32_LogicalDisk",,48) For Each objItem in colItems Wscript.Echo "-----------------------------------" Wscript.Echo "Win32_LogicalDisk instance" Wscript.Echo "-----------------------------------" Wscript.Echo "Caption: " & objItem.Caption Wscript.Echo "Description: " & objItem.Description Wscript.Echo "VolumeSerialNumber: " & objItem.VolumeSerialNumber Next Thanks, I did copied this into Notebook, saved it as "DiskDriveInfo.vbs" but it did not list my 8 HDDs (some Bitlockered), but rather gave a series of texts. You need to runWMI scripts 'As Administrator' to get all its info returned. -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
#45
|
|||
|
|||
SSDs serial No in BIOS.
On Sun, 18 Mar 2018 23:29:29 -0400, GS wrote:
On Sun, 18 Mar 2018 07:41:59 -0400, GS wrote: On Sun, 18 Mar 2018 15:44:01 +1100, Peter Jason wrote: I've just cloned my System SSD to a new one because of the endless "run CHKDSK" flags in the RHS notification panel. I bought the same brand & size as the old one, a "Samsunh 850 EVO". In the BIOS there seems to be no way to tell these apart, no serial numbers or other properties. How is one to tell them apart? I had to go to disk management and see which had the "offline" disabled, then shutting down and unplugging the old SSD & starting all up again. All seems well now; but we'll see. Save this script to a file named "DiskDriveInfo.vbs", then double-click it to get info for every drive on your machine. strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") Set colItems = objWMIService.ExecQuery( _ "SELECT * FROM Win32_LogicalDisk",,48) For Each objItem in colItems Wscript.Echo "-----------------------------------" Wscript.Echo "Win32_LogicalDisk instance" Wscript.Echo "-----------------------------------" Wscript.Echo "Caption: " & objItem.Caption Wscript.Echo "Description: " & objItem.Description Wscript.Echo "VolumeSerialNumber: " & objItem.VolumeSerialNumber Next Thanks, I did copied this into Notebook, saved it as "DiskDriveInfo.vbs" but it did not list my 8 HDDs (some Bitlockered), but rather gave a series of texts. You need to runWMI scripts 'As Administrator' to get all its info returned. I can't get it started. How do I get it into the CMD screen? Can it be started with a RH mouse click? |
Thread Tools | |
Display Modes | Rate This Thread |
|
|