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

Posted on 2006-05-15
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
    Greetings shirwaziri,

    Check this please:

    Good Luck!

    LVL 9

    Accepted Solution

    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.  
    LVL 6

    Expert Comment

    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

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    This is the first one of a series of articles I’ll be writing to address technical issues that are always referred to as network problems. The network boundaries have changed, therefore having an understanding of how each piece in the network  puzzl…
    I'm a big fan of Windows' offline folder caching and have used it on my laptops for over a decade.  One thing I don't like about it, however, is how difficult Microsoft has made it for the cache to be moved out of the Windows folder.  Here's how to …
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    729 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

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now