Serial Number

This forum is for eXpress++ general support.
Message
Author
MIGUELON
Posts: 135
Joined: Wed Feb 10, 2010 10:55 am

Serial Number

#1 Post by MIGUELON »

Hello everyone, I need to know the serial number of a computer to control the licenses of my software
In a DOS window with the CMD command typing:
wmic bios get serialnumber
It gives me this information but I would like to have the serial number directly from my application in Xbase ++
Any ideas ??

Greetings to all and Merry Christmas

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

Re: Serial Number

#2 Post by Victorio »

several ways>
one read it from registry
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Lenovo\MachineInfo
second create output file from command line prompt wmic bios get serialnumber >tempfile1
and read SN from it
and third with llCall("Xpprt1.dll",..., "...") but I do not know parameter for SN , also I do not sure if it is possible, but I use it for read number of CPU cores like this :
i := DllCall("Xpprt1.dll",DLL_CDECL, "_sysGetCPU")

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

Re: Serial Number

#3 Post by MIGUELON »

Thank you very much for the solutions provided
I cannot use the first one because it refers to a type of computer in the Windows registry "LENOVO" and my clients have different brands
The second option is the one I have implemented but it doesn't work with> File Name.
It works like this:
wmic /output:filename bios get serialnumber
The third solution is the one I would like to implement but like you I don't know how to do it
Thanks a lot

reganc
Posts: 257
Joined: Thu Jan 28, 2010 3:08 am
Location: Hersham, Surrey, UK
Contact:

Re: Serial Number

#4 Post by reganc »

On this topic, I saw the following command line which I also thought was interesting:

wmic baseboard get product,version,serialnumber
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Serial Number

#5 Post by rdonnay »

wmic baseboard get product,version,serialnumber
That's cool. Works good.
The eXpress train is coming - and it has more cars.

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

Re: Serial Number

#6 Post by skiman »

Hi,

Create a serial.bat from your application. This should contain 2 lines:
1. goto to the path you want.
2. execute wmic /output:filename bios get serialnumber

Start this serial.bat from your application.
Read the filename that is created. It will be available in the folder you specified in the bat file.
Best regards,

Chris.
www.aboservice.be

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

Re: Serial Number

#7 Post by MIGUELON »

This option works but I would like to know if we can improve it
Thank you all for your ideas

********************
function CualEsElNumeroDeSerie
********************
local nPuntero,cLinea:=space(60)
runshell('/C wmic /output:Serie.SIL bios get serialnumber',,.f.,.t.)
nPuntero:=fopen("Serie.sil", FO_READ )
fread(nPuntero,@cLinea,60)
cLinea:=substr(strtran(cLinea,chr(0),""),15,20)
fclose(nPuntero)
return(cLinea)

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

Re: Serial Number

#8 Post by Auge_Ohr »

hi,
I need to know the serial number of a computer to control the licenses of my software
WOW you have Software which need "Protection" ...
than you ask for a "safe" Way ... but if i answer you everybody will read it ;)

---

i don´t think that WMI give you a "Serial" which "make sense" to "identify" a PC.
here are 13 x WMI Sourve which have "Serial" inside
WMI_SERIAL.ZIP
(17.54 KiB) Downloaded 570 times
greetings by OHR
Jimmy

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

Re: Serial Number

#9 Post by Tom »

Create a serial.bat from your application.
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. ;)
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

#10 Post by messaoudlazhar »

Hi,

Insert this line then read the file 'BiOsSern.txt' containing the serial number :

RunShell('/C wmic Bios Get SerialNumber >BiOsSern.txt',,,.T.)

Good work

Messaoud Mohamed Lazhar

Post Reply