How to change multiple PC's gateways in one shot, possible a script of some sort

Posted on 2006-05-15
Medium Priority
Last Modified: 2010-03-18
I currently have a script that will change a computers gateway by double clicking on the batch file that I created.  Very simple batch file script, i have pasted it below.

netsh interface ip set address name="Local Area Connection" gateway= gwmetric=0
We have several gateways in our network, for various reasons.  But, I would like to change 10 computers gateways at one shot.  Is there any guru out there that can help we.  Even If you have changed just two or more PC's gateway by simplfying for users.  Your help will be gratiously appreciated. Also, if there is anyway possible for this to happen, where a group policy, preferably a script, or some command.  Please let me know.

Thank you,

Question by:shirwaziri
LVL 15

Expert Comment

by:Naser Gabaj
ID: 16685094
Greetings shirwaziri,

Check this please:


Good Luck!


Accepted Solution

MCPJoe earned 2000 total points
ID: 16690922
One way I do this is with Automate from a company called Network Automation, you can create your scripts, create variables and run your script to read from a text file of the PCs you want to change.  It will look through and execute your script automatically.  

Expert Comment

ID: 16697930
You cold use your simple batch script and run it from login script.
You cold trigger it with “user name” or something like that.

And it should be possibly to run from GPO.

Running CMD command like this from script you need to call it like this.

cmd.exe /c netsh interface ip set address name="Local Area Connection" gateway= gwmetric=0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A brief overview to explain gateways, default gateways and static routes OR NO - you CANNOT have two default gateways on the same server, PC or other Windows-based network device. In simple terms a gateway is formed when a computer such as a serv…
Greetings, Experts! First let me state that this website is top notch. I thoroughly enjoy the community that is shared here; those seeking help and those willing to sacrifice their time to help. It is fantastic. I am writing this article at th…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

850 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