if you are using W2k, XP or .NET use the 'netsh' command
C:\>netsh /?
Usage: netsh [-a AliasFile] [-c Context] [-r RemoteMachine]
[Command | -f ScriptFile]
The following commands are available:
Commands in this context:
? - Displays a list of commands.
add - Adds a configuration entry to a list of entries.
delete - Deletes a configuration entry from a list of entries.
dump - Displays a configuration script.
exec - Runs a script file.
help - Displays a list of commands.
interface - Changes to the `interface' context.
ras - Changes to the `ras' context.
routing - Changes to the `routing' context.
set - Updates configuration settings.
show - Displays information.
The following subcontexts are available:
routing interface ras
To view help for a command, type the command, followed by a space, and then
type ?.
----------
netsh int ip set address local static 192.168.20.10 255.255.255.0 192.168.20.1
or
netsh int ip set address "Local Area Connection 2" source=dhcp
or
netsh int ip set address local source=dhcp
netsh int ip set dns local source=dhcp
netsh int ip set wins local source=dhcp