You are currently offline, waiting for your internet to reconnect

How to Use the Dhcpcmd.exe Tool Included with Support Tools

This article was previously published under Q232213
This article has been archived. It is offered "as is" and will no longer be updated.
Administrators can use the Dhcpcmd.exe tool to manage a Dynamic Host Configuration Protocol (DHCP) server from a command line, and is included in the Windows NT 4.0 Service Pack 4 Support Tools. This article describes the syntax of the Dhcpcmd.exe tool in detail.
More information

Downloading the Support Tools

To download the Windows NT 4.0 Support tools, see the following Microsoft Web site:

Dhcpcmd.exe Syntax

The syntax of the Dhcpcmd.exe tool is
dhcpcmd srvipaddress command [command parameters]
Where command is one of the following commands:

General Commands

  • AddReservedIp
  • RemoveReservedIp
  • GetVersion
  • MibCounts
  • ServerConfig
  • CheckDB

Subnet Commands

  • CreateSubnet
  • DeleteSubnet
  • SetSubnetState

Range Commands

  • AddIpRange
  • AddExcludeRange
  • RemoveExcludeRange

Active-Lease Commands


Superscope Commands

  • SetSuperScope
  • DeleteSuperScope
  • GetSuperScopeTable
  • RemoveSubScope

Option Commands

  • EnumOptions
  • CreateOption
  • DeleteOption
  • SetGlobalOptionValue
  • SetGlobalOptionValues
  • RemoveGlobalOptionValue
  • SetSubnetOptionValue
  • RemoveSubnetOptionValue
  • SetReservedOptionValue
  • RemoveReservedOptionValue

General Commands


Description: Adds a reserved Transport Control Protocol/Internet Protocol (TCP/IP) address to an already existing scope.

Command syntax: Dhcpcmd ServerIpAddress AddReservedIp ScopeAddress ReserveIp HardwareString [Clientname] [ClientComment] [DHCP|Bootp|Both]

Example: dhcpcmd addreservedip 08002B30369B nursvd1 dhcp


Description: Removes a reserved TCP/IP address from the existing scope it belongs to.

Command syntax: Dhcpcmd ServerIpAddress RemoveReservedIp ScopeAddress ReserveIp HardwareString

Example: dhcpcmd removereservedip 08002B30369B


Description: Displays the DHCP server version

Command syntax: Dhcpcmd ServerIpAddress GetVersion

Example: dhcpcmd getversion


Description: Displays DHCP server statistic information for the current DHCP server.

Command syntax: Dhcpcmd ServerIpAddress MibCounts

Example: dhcpcmd mibcounts


Description: Displays and sets server parameters.

Command syntax: Dhcpcmd ServerIpAddress ServerConfig [ConfigParameter] [Value]

Where ConfigParameter is any of the DHCP server parameters, and Value is the value you want to set that parameter to.

NOTE: Type dhcpcmd serveripaddress serverconfig to display a list of the DHCP server parameters.

Examples: dhcpcmd serverconfig

dhcpcmd serverconfig backupinterval 15

The first example displays DHCP server parameters, and the second example sets the BackupInterval parameter to 15.


Description: Displays the DHCP scope information database.

Command syntax: Dhcpcmd ServerIpAddress checkdb scope_address [Fix]

Example: dhcpcmd checkdb fix

NOTE: The Fix parameter reconciles the database. If you do not use the Fix parameter, only the DHCP server version and the "command successfully completed" informational message are displayed.

Subnet Commands


Description: Creates a new subnet, and should be immediately followed by the AddIpRange command. If not, your computer can be inconsistent and the server may not behave as expected.

Command syntax: Dhcpcmd server_IP_address CreateSubnet scope_address scope_mask scope_name

Example: dhcpcmd createsubnet mysubnet


Description: Deletes an existing subnet.

Command syntax: Dhcpcmd ServerIpAddress DeleteSubnet scope_address force_flag

Where force_flag = dhcpfullforce or dhcpnoforce

If you use dhcpfullforce, all clients with active leases in that scope are deleted before the scope is deleted. If there are clients with active leases in a scope, dhcpfullforce must be specified or deletesubnet does not work.

Example: dhcpcmd deletesubnet dhcpfullforce

This command deletes the subnet and any leases that are present for this subnet.


Description: Enables and disables a subnet.

Command syntax: Dhcpcmd ServerIpAddress setsubnetstate scope_address state

Where state has a value of 0 if the scope is to be enabled and a value of non-0 if the scope is to be disabled.

Example: dhcpcmd setsubnetstate 0

Range Commands


Description: Adds another IP range to an already existing scope.

Command syntax: Dhcpcmd ServerIpAddress AddIPRange ScopeAddress StartIpRange EndIpRange

Example: dhcpcmd addiprange


Description: Adds a range of exclusion addresses to the scope.

Command syntax: Dhcpcmd ServerIpAddress AddExcludeRange scope_address start_excl end_excl

Example: dhcpcmd addexcluderange

This command excludes IP addresses between and


Description: Removes an existing exclusion range.

Command syntax: Dhcpcmd ServerIpAddress RemoveExcludeRange scope_address start_excl end_excl

Example: dhcpcmd removeexcluderange

This command removes an existing exclusion of IP addresses from 10.0.01 to

Active-Lease Commands


Description: Lists the lease information in a different format.

Command syntax: Dhcpcmd ServerIpAddress EnumClients ScopeAddress [-v | -h]

Where -v displays detailed lease information and -h displays lease and hardware information.

Example: dhcpcmd enumclients -h

Superscope Commands


Description: Sets the superscope that a scope belongs to, creating the superscope if it does not already exist.

Command syntax: Dhcpcmd ServerIpAddress SetSuperScope superscope_name scope_address {1/0}

If the value of the last parameter is 1, the superscope is changed even if the scope belongs to some another scope. If the value is 0, an error message is returned if the scope belongs to another superscope.

Example: dhcpcmd setsuperscope newsuperscope 1


Description: Deletes a superscope and optionally converts all subordinate elements to a different superscope. If the target superscope does not exist, it is created.

Command syntax: Dhcpcmd ServerIpAddress DeleteSuperScope [different_superscope_name]

Example: dhcpcmd deletesuperscope newsuperscope


Description: Retrieves the full superscope information.

Command syntax: Dhcpcmd ServerIpAddress GetSuperScopeTable

Example: dhcpcmd getsuperscopetable


Description: Removes a particular scope from its current superscope.

Command syntax: Dhcpcmd ServerIpAddress RemoveSubScope subscope_address

Example: dhcpcmd removesubscope

Option Commands


Description: Lists all option information.

Command syntax: Dhcpcmd ServerIpAddress EnumOptions

Example: dhcpcmd enumoptions


Description: Creates a new option definition.

Command syntax: Dhcpcmd ServerIpAddress CreateOption option_idoption_name [default_value_type default_value]

Where option_id is a number less than or equal to 255 and value_type is one of the following values:
  • Byte - An 8-bit unsigned integer
  • Word - A 16-bit unsigned integer
  • String - An ASCII text string
  • IPAddress - A TCP/IP address in dotted-decimal w.x.y.z format
Example: dhcpcmd createoption 255 switchednetwkID string 0


Description: Deletes an existing option.

Command syntax: Dhcpcmd ServerIpAddress DeleteOption option_id

Example: dhcpcmd deleteoption 253


Description: Sets a global option value.

Command syntax: Dhcpcmd ServerIpAddress SetGlobalOptionValue option_id option_type option_value

Example: dhcpcmd setglobaloptionvalue 255 string 111222333


Description: Sets several global option values at a time.

Command syntax: Dhcpcmd ServerIpAddress SetGlobalOptionValues option_id option_type option_value [option_id option_type option_value] [...]

Example: dhcpcmd setglobaloptionvalues 255 string 123 254 ipaddress


Description: Removes the global option value. Note that this is not the same as removing the option itself.

Command syntax: Dhcpcmd ServerIpAddress RemoveGlobalOptionValue option_id

Example: dhcpcmd removeglobaloptionvalue 255

The value is removed but the global option also disappears from the Option Configuration window and the option is put back in the unused option list. If you manually move it to the active option list, this option shows a value of 0 in the Option Configuration window.


Description: Adds an option value to a scope option.

Syntax: Dhcpcmd ServerIpAddress SetSubnetOptionValue subnet_address option_id option_type option_value

Example: dhcpcmd setsubnetoptionvalue 255 string 123


Description: Removes a subnet option.

Command syntax: Dhcpcmd ServerIpAddress RemoveSubnetOptionValue subnet_address option_id

Example: dhcpcmd removesubnetoptionvalue 254

The value is changed to 0 and the option is still shown in the Option Configuration window.


Description: Sets the option value for a reservation.

Command syntax: Dhcpcmd ServerIpAddress SetReservedOptionValue reserved_subnet reserved_IP_address option_id option_type option_value

Example: dhcpcmd setreservedoptionvalue 255 string 777


Description: Removes an option defined for a reservation.

Command syntax: Dhcpcmd ServerIpAddress RemoveReservedOptionValue reserved_subnet reserved_IP_address option_id

Example: dhcpcmd removereservedoptionvalue 255

Article ID: 232213 - Last Review: 12/05/2015 14:36:32 - Revision: 2.0

Microsoft Windows NT Server 4.0 Standard Edition, Microsoft Windows NT Server 4.0 Enterprise Edition

  • kbnosurvey kbarchive kbhowto KB232213