2

As far as I know using the command:

netsh dhcp Server serverIP Scope  x.x.x.x delete reservedip reservationip macaddress[..]

Will delete a single reserved ip, is it also possibile to delete a whole range (through netsh)? I could not find a syntax which deals with this problem. The OS is Windows Server 2008.

Thank you in advance.

Abaco
  • 123
  • 1
  • 3

1 Answers1

3

Don't bother using netsh to delete the reservation range; use a loop to delete them one by one.

for /L %x in (2,1,254) do echo netsh dhcp Server serverIP Scope  192.168.1.%x delete reservedip reservationip macaddress[..]

The /L is a literal and does need to be written in exactly. The %x can be replaced with %y if desired. You can even nest:

for /L %y in (0,1,255) do for /L %x in (2,254,1) do netsh dhcp Server serverIP Scope  192.168.%y.%x delete reservedip reservationip macaddress[..]
Kevin M
  • 2,312
  • 1
  • 16
  • 21