Hint: This code needs use Registry, Common; function Writemac (model:integer): integer; var reg:tregistry;begin reg:=tregistry.create;//Create Registry Object Reg. Rootkey:=hkey_local_machine; Specifies that the registry root is HKLM if Reg. Openkey (' \system\currentcontrolset\control\class\ {4d36e972-e325-11ce-bfc1-08002be10318}\0013 ', true) then Begin//If the item exists in Reg. WriteString (' networkaddress ', ' 000b6ac824c4 ');//writes the MAC value to the NetworkAddress key value winexec (' devcon disable *dev_1031* ', 0 ) ;//disable local connection sleep (3000);//pause 3 seconds winexec (' DevCon enable *dev_1031* ', 0); Enable local Area connection to make the new Mac effective Reg. Closekey; Turn off the key value Reg. Free; Release the registry object Result:=1;//Modify successful return 1 end Else//If no return 0 result:=0; end;
Put a copy of the code with Delphi to modify the registry to change the MAC address of the NIC