Hi,
I know that in the MS Windows' "command prompt windows" I can type:
WMIC BIOS GET SERIALNUMBER
to get BIOS serial number. so how can I get it with LISP?
Thanks,
Solved! Go to Solution.
Solved by pbejse. Go to Solution.
Hi
I also find another way via VBS
make a text file and rename it to 1.vbs
paste below code and save and double click on icon:
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
Hi
here a lisp program that extract all system information:
(defun c:SystemInfo(/ item meth1 meth2 process wmi) (defun lister(val / it) (vlax-for it val (princ (strcat "\n" (vlax-get it 'name) " : ")) (if (vlax-get it 'value) (princ (vlax-get it 'value)) (princ "Nil")) ) ) (vl-load-com) (setq WMI (vlax-create-object "WbemScripting.SWbemLocator")) (setq meth1 (vlax-invoke WMI 'ConnectServer nil nil nil nil nil nil nil nil)) (foreach process (list "BIOS" "Processor" "VideoController" "SoundDevice" "CDROMDrive" "OperatingSystem" "ComputerSystem" "PhysicalMemory" "DiskDrive") (setq meth2 (vlax-invoke meth1 'ExecQuery (strcat "Select * from Win32_" Process))) (princ (strcat "\nfeatures of " process " :")) (vlax-for item meth2 (lister (vlax-get item 'Properties_)) (lister (vlax-get item 'Qualifiers_)) (getkword "\nPress Enter to continue...") ) );;foreach (mapcar 'vlax-release-object (list meth1 meth2 wmi)) (princ) )
So, does anybody can summerize it to a single function that gives me just Bios.SerialNumber as a string variable?
Thanks,
@aqdam1978 wrote:So, does anybody can summerize it to a single function that gives me just Bios.SerialNumber as a string variable?
Thanks,
(defun c:SerialInfo (/ WMI meth1 meth2 serial) (vl-load-com) (cond ((and (setq WMI (vlax-create-object "WbemScripting.SWbemLocator")) (setq meth1 (vlax-invoke WMI 'ConnectServer nil nil nil nil nil nil nil nil)) (setq meth2 (vlax-invoke meth1 'ExecQuery (strcat "Select * from Win32_" "BIOS"))) (vlax-for itm (vlax-get (vlax-invoke meth2 'ItemIndex 0) 'Properties_) (if (eq (vlax-get itm 'name) "SerialNumber") (setq serial (vlax-get itm 'value))))))) (mapcar 'vlax-release-object (list meth1 meth2 wmi)) serial)
HTH