Serial Number

This forum is for eXpress++ general support.
Message
Author
User avatar
Auge_Ohr
Posts: 1405
Joined: Wed Feb 24, 2010 3:44 pm

Re: Serial Number

#11 Post by Auge_Ohr »

MIGUELON wrote: Wed Nov 25, 2020 3:09 am wmic bios get serialnumber
i get this
SerialNumber
To Be Filled By O.E.M.
---

you can use "| CLIP" to redirect from Console to Clipboard

Code: Select all

wmic bios get serialnumber | CLIP
but as i say it does not give me "usefull" Information on my PC

when test those 13 WMI Files you will recognize that it often is empty when test with different PC
so you need to search for more Hardware "Serial" than only BIOS
greetings by OHR
Jimmy

User avatar
PedroAlex
Posts: 229
Joined: Tue Feb 09, 2010 3:06 am

Re: Serial Number

#12 Post by PedroAlex »

xBtools VolSerial() it is not a solution?
Pedro Alexandre

skiman
Posts: 1183
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Serial Number

#13 Post by skiman »

Working with batch files/jobs is not a good idea. It was in the eighties, nineties, but today, it's a little like using a fax device. ;)
Yes, as in the eighties, it always work. ;)
Best regards,

Chris.
www.aboservice.be

MIGUELON
Posts: 135
Joined: Wed Feb 10, 2010 10:55 am

Re: Serial Number

#14 Post by MIGUELON »

Hi Auge_ohr, thanks for the .ZIP file but when I try to download it it tells me that it is not available and I see that it has been downloaded 29 times. I don't know how others download it
On the other hand, thank you also for warning me that the serial number of the BIOS is not infallible and that certain computers can return an empty serial number
I will take your recommendations into account and use other serial numbers such as MAC etc.
I can also use the serial number of the hard drive
In general, thank you all for your ideas. I suppose that as software creators you will want to protect your creations.

User avatar
Tom
Posts: 1165
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: Serial Number

#15 Post by Tom »

Yes, as in the eighties, it always work.
Is that your experience? Mine is different. You don't have any control on batch jobs, you don't get any usable return values, and you may try to create/execute them in an environment where the administration disallowed almost everything. If there is any chance to get the job done by calling API functions, using 3rd party DLLs or other more reliable stuff, we avoid batch jobs like the devil avoids the holy water (as we say in germany, even if we are atheists).
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

messaoudlazhar
Posts: 42
Joined: Mon Dec 23, 2013 2:10 pm
Contact:

Re: Serial Number

#16 Post by messaoudlazhar »

Hi,
I created this function and I tested it, it works fine :

Code: Select all

Function GetSerialBios
LOCAL nfile, nlngf, xMPos:=0, VarRetBS:=""

RunShell("/C wmic Bios Get SerialNumber >ChMMLBS.txt",,,.T.)
nfile:=Fopen("ChMMLBS.txt",66)
nlngf:=fsize(nfile)
Do while xMPos<nlngf
   CharRead:=freadstr(nfile,1)
   If Asc(CharRead)>31
      VarRetBS+=CharRead
   Endif
   xMPos++
Enddo
RunShell("/C del ChMMLBS.txt",,,.T.)
Return Trim(Subs(VarRetBS,At("er ",VarRetBS)+4))
Messaoud Mohamed Lazhar

User avatar
Auge_Ohr
Posts: 1405
Joined: Wed Feb 24, 2010 3:44 pm

Re: Serial Number

#17 Post by Auge_Ohr »

hi,
PedroAlex wrote: Thu Nov 26, 2020 8:52 am xBtools VolSerial() it is not a solution?
that SN you got when "Format" a Hdd/Sdd. it is NOT the "real" SN
as i know it work like Win32_LogicalDisk which have

Code: Select all

                   oService:getProperty( "Caption" ), ;
                   oService:getProperty( "Description" ), ;
                   oService:getProperty( "DeviceID" ), ;
                   oService:getProperty( "DriveType" ), ;
                   oService:getProperty( "FileSystem" ), ;
                   oService:getProperty( "FreeSpace" ), ;
                   oService:getProperty( "Name" ), ;
                   oService:getProperty( "Size" ), ;
                   oService:getProperty( "VolumeName" ), ;
                   oService:getProperty( "VolumeSerialNumber" ) } ) }
with

Code: Select all

   DeviceID  : C:
but "real" SN is when using Win32_DiskDrive

Code: Select all

                   oService:getProperty( "Caption" ), ;
                   oService:getProperty( "Description" ), ;
                   oService:getProperty( "DeviceID" ), ;
                   oService:getProperty( "InterfaceType" ), ;
                   oService:getProperty( "MediaLoaded" ), ;
                   oService:getProperty( "MediaType" ), ;
                   oService:getProperty( "Model" ), ;
                   oService:getProperty( "Name" ), ;
                   oService:getProperty( "PNPDeviceID" ), ;
                   oService:getProperty( "Size" ), ;
                   oService:getProperty( "SerialNumber" ), ;
                   oService:getProperty( "Signature" ), ;
                   oService:getProperty( "TracksPerCylinder" ) } ) }
Problem : you do not get a "Drive-Letter" ... it is a Device ... here 3rd SSD

Code: Select all

   DeviceID  : \\.\PHYSICALDRIVE2
   Index     :          2   
   
greetings by OHR
Jimmy

Victorio
Posts: 620
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

Re: Serial Number

#18 Post by Victorio »

Hi,
It is also "old" solution, but I have one software that after installation create some hash code, this code I must send to seller, he send me back second hash file to save to my install directory and software I can activate.
He create hash file from several components in system (HDD, BIOS,...)
When I change HDD, i must againg create hash, send to seller, and he send me back activate file.
This prevent to unanthorized installation but need invervention with seller. When seller close his business, I have problem :( because this is not good solution for user and also for seller because when many user this is some time to support after sale.

Post Reply