That's a VERY good question I often wondered that myself until I stumbled upon a website talking about that.
Alright for Windows 2000/XP there is a command for just that:
Well since I got that off a site I'll just paste the dump here
How can I configure my IP address and other settings from the command prompt?
In Windows 2000 (and in XP) you can use the NETSH utility to do just that, and much more. Netsh.exe is a tool an administrator can use to configure and monitor Windows-based computers at a command prompt.
You can use the Netsh.exe tool to perform the following tasks:
Configure routing protocols.
Configure remote access behavior for Windows-based remote access routers that are running the Routing and Remote Access Server (RRAS) Service.
Display the configuration of a currently running router on any computer.
Use the scripting feature to run a collection of commands in batch mode against a specified router.
To save your current IP settings:
netsh -c interface dump > c:\data\interface.txt
To restore (or configure) your settings from a text file:
netsh -f c:\data\interface.txt
If you need to plug your laptop into different networks, you can save and restore the appropriate network configuration using netsh.exe. When you have your laptop correctly configured for your office network, you can save the network configuration for later restoration.
OK. Now you take the laptop back to the office and you need to reconfigure for the office environment: nic address, wins, gateway address... Use the following command to restore your office network interface:
netsh -f c:\configs\officeinterface.txt
At end of day, you take it home. To setup for home, run:
netsh -f c:\configs\homeinterface.txt
As you can imagine, this is very valuable if you have get your laptop to function in multiple network locations.
You can also use the NETSH command in Windows 2000 or XP to script the process of changing a computer from a static IP address to Dynamic Host Configuration Protocol (DHCP) or vice versa. The NETSH command accomplishes this task without the need to restart the computer. This feature is particularly useful for laptops that move from one environment to another, when it is necessary to use statically assigned IP addresses at one location and DHCP assigned IP addresses at another.
To switch the specified adapter from a static address to DHCP, type the following command:
netsh interface ip set address "Local Area Connection" dhcp
To display all of the adapters in the computer with their current IP addresses to determine the correct adapter name, type the following command:
netsh interface ip show config
To change to a static address, type the following command:
netsh interface ip set address "Local Area Connection" static ipaddr subnetmask gateway metric
Note: Replace ipaddr with the static IP address, subnetmask with the subnet mask, gateway with the default gateway and, if necessary, metric with the appropriate metric. The following example changes the interface "Local Area Connection" to a static address of 192.168.0.10 with a subnet mask of 255.255.255.0, and the interface has a default gateway of 192.168.0.1 with a metric of 1:
netsh interface ip set address "Local Area Connection" static 192.168.0.10 255.255.255.0 192.168.0.1 1