Listing 1: CreateDHCPScope.cmd @Echo Off If #%8#==## Goto :syntax Set server=%1 Set netid=%2 Set subnetmask=%3 Set name=%4 Set comment=%5 Set gateway=%6 Set iprangestart=%7 Set iprangeend=%8 :: BEGIN CALLOUT A Echo Creating DHCP Scope... Netsh dhcp server %server% add scope %netid% %subnetmask% %name% > NUL Netsh dhcp server %server% scope %netid% set name %name% > NUL Netsh dhcp server %server% scope %netid% set comment %comment% > NUL :: END CALLOUT A :: BEGIN CALLOUT B Echo Configuring IP range and default gateway... Netsh dhcp server %server% scope %netid% add iprange %iprangestart% %iprangeend% BOTH > NUL Netsh dhcp server %server% scope %netid% set optionvalue 003 IPADDRESS %gateway% > NUL :: END CALLOUT B :: BEGIN CALLOUT C Echo Activate scope... Netsh dhcp server %server% scope %netid% set state 1 > NUL :: END CALLOUT C Echo Done! Goto :EOF :syntax Echo. Echo Syntax: CreateDHCPScope.cmd ^ ^ ^ ^ ^ ^ ^ ^ Echo. Echo Example: CreateDHCPScope.cmd \\MyDHCPServer 192.168.100.0 255.255.255.0 "Test Scope" "Test Scope Description" 192.168.100.1 192.168.100.2 192.168.100.254 Echo. Goto :EOF