Today I looked into a batch file for binding an IP. The file is as follows:
if exist ipconfig.txt del ipconfig.txt
ipconfig /all >ipconfig.txt
if exist phyaddr.txt del phyaddr.txt
find "Physical Address" ipconfig.txt >phyaddr.txt
for /f "skip=2 tokens=12" %%M in (phyaddr.txt) do set Mac=%%M
phyaddr.txt is shown as:
---------- IPCONFIG.TXT
Physical Address. . . . . . . . . : 00-60-B3-6E-EB-69
What I want to know is, what does tokens=12 mean???
Also, if I want to export the value of the variable MAC to 1.txt, how should I do it?
I've thought about it for a long time, and I hope an expert can give me some pointers. Thanks.
if exist ipconfig.txt del ipconfig.txt
ipconfig /all >ipconfig.txt
if exist phyaddr.txt del phyaddr.txt
find "Physical Address" ipconfig.txt >phyaddr.txt
for /f "skip=2 tokens=12" %%M in (phyaddr.txt) do set Mac=%%M
phyaddr.txt is shown as:
---------- IPCONFIG.TXT
Physical Address. . . . . . . . . : 00-60-B3-6E-EB-69
What I want to know is, what does tokens=12 mean???
Also, if I want to export the value of the variable MAC to 1.txt, how should I do it?
I've thought about it for a long time, and I hope an expert can give me some pointers. Thanks.
