Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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[..]
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.