You are not logged in.

#1 30 Mar 2007 05:18

NDog
Member
From: New Zealand
Registered: 31 May 2006
Posts: 121
Website

Set Mac Address as a variable

We frequently clone the computers at work so i need a way to retrieve the mac address on the startup script and set it as a variable so i can then compare it with a database and asign it the correct ip and pc name.

If anyone already has an easier way of retrieving the mac address I will be happy to know your method but this is my attempt so far.

FOR /F "skip=13" %%G IN ('ipconfig /all') DO SET macaddress=%%G
echo %macaddress%
pause

I have used skip=13 because that line is where physical adress is on, but i want it to just retrieve the mac address on line 13 and set it as %macaddress%

Last edited by NDog (30 Mar 2007 08:28)


cmd, vbs, ps, bash
autoit, python, swift

Offline

#2 30 Mar 2007 18:21

Simon Sheppard
Admin
Registered: 27 Aug 2005
Posts: 1,130
Website

Re: Set Mac Address as a variable

Offline

Board footer

Powered by