Solved

Command Live Instruction to change IP Address - Windows 7

Posted on 2013-11-12
2
493 Views
Last Modified: 2013-11-12
Say,

I wish to change the gateway of my Windows 7 PC using command line instruction. From time to time i need to choose a different router and keep looking for quick & simple ways to achieve this - how can i do it?

TX
0
Comment
Question by:shaunwingin
2 Comments
 
LVL 84

Expert Comment

by:oBdA
ID: 39643820
You can do that with netsh.exe (see http://technet.microsoft.com/en-us/library/bb490943.aspx); replace "Ethernet" with the name of the card you want to configzure, and 1.2.3.4 obviously with your gateway address:
netsh.exe interface ip set address name="Ethernet" gateway=1.2.3.4

Open in new window

0
 
LVL 43

Accepted Solution

by:
Steve Knight earned 500 total points
ID: 39643834
Or for temporary changes I would normally change the routing table and keep your gateway the same:

route delete 0.0.0.0
route add 0.0.0.0 mask 0.0.0.0 X.X.X.X

Use this to see the results:

route print

That will need to be run as admin, e.g. a quick batch file:

@echo off
route print | find " 0.0.0.0"
Set Gateway=1.2.3.4
set /p Gateway=Enter new gateway - press return for %gateway%:
route delete 0.0.0.0
route add 0.0.0.0 mask 0.0.0.0 %gateway%

Steve
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
This Micro Tutorial will go in depth within Systems and Security in Windows 7 and will go into detail regarding Action Center, Windows Firewall, System, etc. This will be demonstrated using Windows 7 operating system.
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question