Serial Number
Serial Number
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
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
Re: Serial Number
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")
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")
Re: Serial Number
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
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
Re: Serial Number
On this topic, I saw the following command line which I also thought was interesting:
wmic baseboard get product,version,serialnumber
wmic baseboard get product,version,serialnumber
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com
Real Business Applications Ltd
http://www.rbauk.com
Re: Serial Number
That's cool. Works good.wmic baseboard get product,version,serialnumber
The eXpress train is coming - and it has more cars.
Re: Serial Number
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.
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.
Re: Serial Number
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)
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)
Re: Serial Number
hi,
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
WOW you have Software which need "Protection" ...I need to know the serial number of a computer to control the licenses of my software
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
greetings by OHR
Jimmy
Jimmy
Re: Serial Number
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.Create a serial.bat from your application.

Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
-
- Posts: 42
- Joined: Mon Dec 23, 2013 2:10 pm
- Contact:
Re: Serial Number
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
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