Eduardo Celiz Posted January 4, 2021 Posted January 4, 2021 (edited) Hello, I am reviewing the following function of lee mac where it returns all the mac addresses of the machine, my query is the following which of these codes does not change by formatting the machine or otherwise, that is, whatever is done to the machine It will continue throwing the same one, which of all it would be and how can I modify the code so that I do not throw away the entire list but rather identify it and that it throw me that code independently. I appreciate your help ;; MAC Addresses - Lee Mac ;; Returns a list of MAC Addresses for all installed network adaptors (defun LM:macaddresses ( / err qry srv wmi ) (if (setq wmi (vlax-create-object "wbemscripting.swbemlocator")) (progn (setq err (vl-catch-all-apply (function (lambda ( / rtn ) (setq srv (vlax-invoke wmi 'connectserver) qry (vlax-invoke srv 'execquery "select macaddress from win32_networkadapter where macaddress is not null") ) (vlax-for itm qry (setq rtn (cons (vlax-get itm 'macaddress) rtn))) ) ) ) ) (foreach obj (list qry srv wmi) (if (= 'vla-object (type obj)) (vlax-release-object obj) ) ) (if (vl-catch-all-error-p err) (prompt (vl-catch-all-error-message err)) err ) ) ) ) Edited January 4, 2021 by Eduardo Celiz Quote
lido Posted January 6, 2021 Posted January 6, 2021 The Internet is full of information about MAC addresses: why, when, how to change this address etc. Just google it! To get answer to your question, the AutoLISP Forum is not the best choice! Quote
ronjonp Posted January 6, 2021 Posted January 6, 2021 Is your question about why the MAC address does not change after a format? Maybe read this and see if it sheds any light. Quote
pkenewell Posted January 6, 2021 Posted January 6, 2021 I think the OP is asking for an address on the computer he can reference that will not change regardless of what is done to the machine i.e. Format Hard Drives, change OS, etc. Quote
ronjonp Posted January 6, 2021 Posted January 6, 2021 Physical mac addresses will not change. Maybe they just need to change this: "select macaddress from win32_networkadapter where macaddress is not null" to this: "Select macaddress from Win32_NetworkAdapter where PhysicalAdapter=TRUE and macaddress is not null" 2 Quote
Eduardo Celiz Posted January 18, 2021 Author Posted January 18, 2021 On 6/1/2021 at 14:58, pkenewell said: Creo que el OP está solicitando una dirección en la computadora a la que pueda hacer referencia que no cambiará independientemente de lo que se haga en la máquina, es decir, formatear discos duros, cambiar el sistema operativo, etc. It is just I look for it, but my doubt is how it does so that it only shows me the mac that is never modified there is a formatting Quote
pkenewell Posted January 19, 2021 Posted January 19, 2021 21 hours ago, Eduardo Celiz said: It is just I look for it, but my doubt is how it does so that it only shows me the mac that is never modified there is a formatting @Eduardo Celiz Sorry but I cannot understand what you are saying. Please try to restate, or just write it in your own language and we will use google translate. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.