For example dhcp server address 192.168.0.1 and file addresses.txt containing following lines (ip, mac):
192.168.1.1, 0012345678, name1, description1
192.168.1.2, 0011223344, name2, description2
192.168.1.3, 0001112223, name3, description3
following line should do exactly what you want:
for /f "tokens=1-4 delims=," %%i in (addresses.txt) do netsh Dhcp Server 192.168.0.1 Scope 192.168.1.0 add reservedip %%i %%j %%k "%%l" BOTH
|