i need to get
- pc serial number
- hard disk serial
by pb 12.6
i need to get
- pc serial number
- hard disk serial
by pb 12.6
Here's a small application that gets the Serial Number of a Hard disk.
See attached.
[EDIT]: I'm using Roland Smith's n_filesys object, with some modifications done by me.
I think I've found some information on how to get the Serial of a PC, but that's going to take me some time.
regards
thanks for you MR Miguel Leeuwe & John Fauss
It's a great gift
Thanks again for helping me
with best regards
Hi Miguel & John;
Thank you so much for going "beyond" on this post to get Mahmoud an answer on his outdated PB 12.6 challenge!
Also, for trying to educate the community on proper etiquette! ;-)
This ones for you guys ...
Regards ... Chris
thanks for you MR Miguel Leeuwe & John Fauss
this tool and helpful give me much of my question
thanks for spending time to help me
with best regards
Attached are two zip files. One contains a PB 2017 app with a simplified window and WMI non-visual object that you can more easily adapt to your own application(s). The other zip file contains the exported source files for every object.
The app is named WMI Easy Query. Here is a screenshot:
There are several sample queries listed in the drop-down, or you can experiment and enter your own query. You'll note in the above screen shot that even though the query asked only for the SerialNumber property, WMI also supplied the Tag property. WMI does this for some WMI classes... I do not know why.
In WMI terminology, "BaseBoard" refers to the PC's motherboard, not the BIOS.
I've included four DataWindow data objects from the CodeXchange example program, even though they are not utilized in this app. One that might be of interest to you is dddw_wmi_class, which lists all of the WMI classes supported when the CodeXchange app was created. This may save you time and effort when researching other WMI classes.
Enjoy!
Hi again,
I've created another sample app, ripping out a lot of code from John. So now you have one sample app for the HardDisk serial number (posted before) and this attached one, to get the PC's serial number.
See attached.
It does not work for a lot of custom build PCs, since the BIOS information is not always set.
regards.
here's a pb 12.6 version of Jonh's CodeXchange project: https://community.appeon.com/index.php/codeexchange/powerbuilder/281-wmi-windows-management-instrumentation-class-properties-inspector#338
See attached
Funny: on my work computer I get "To be filled by O.E.M." The reason for this is that manufacturers of custom build PC's might not set this value in the BIOS.
Maybe a better way to uniquely identify your PC, is to use the MAC address. But of course, network cards can be changed. (as well as hardware drives) !!!
Mahmoud, what do you really need this information for?
regards.
@John, I just found your code on CodeXchange: Awesome !
Any idea which Class Category that is?
I'll rip it and try to create a 12.6 version of it.
regards,
MiguelL
Hi,
You're welcome.
You've accepted the answer, but you still don't know how to get the Serial of the PC itself.
You can run a powershell and run this command:
Get-WmiObject win32_bios | select Serialnumber
Or you can run a vbs script with this contents:
On Error Resume Next
Dim strComputer
strComputer = InputBox("Enter the name of the computer:")
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSMBIOS = objWMIService.ExecQuery ("Select * from Win32_SystemEnclosure")
For Each objSMBIOS in colSMBIOS
MsgBox strComputer & ": " & objSMBIOS.SerialNumber
Next
Once I've figured out how to run a powershell command from Powerbuilder I'll post it here. (I know I have that somewhere ...).
regards
thanks for your helpful MR Miguel Leeuwe
Mr Miguel and Mr john
I'm very sorry I didn't mean that your words
And you are right
I'm very sorry for all people
And I thank you for your advice ? ? ?
Just a tip:
I don't want to make this personal, but learn how to say "Hi", "Please" and now an then a "Thank you" when people help you.
I understand that there's language barriers and that everyone has a different education. In a lot of your posts, you can also be a bit more descriptive. Many times we keep guessing.
In my humble opinion, it's annoying and sorry to be frank with you, but you might get better / more help if you take this in account. (at least if you appreciate any help from me).
Best regards,
MiguelL
regards.
:)