Solved

using a batch file to change primary dns address

Posted on 2010-08-25
3
819 Views
Last Modified: 2012-06-27
hello, I'm trying to use this batch file to automatically place a primary dns address within the Internet Protocol (TCP/IP) Properties window.  this batch file works on most pc's but doesn't work on all of them.  everyone here is using windows xp pro sp2.  any suggestions?
@echo off

REM - This prompts the user as to whether to switch the desktop to JFKD81

set userin=

cls

set /p userin=Do you want to switch to the LSF 9.1 environment? y/n :  

IF not %userin% == y goto else

cls

color 74

netsh interface ip set dns "Local Area Connection" static 192.168.1.29

ipconfig /flushdns

echo #

echo #

@echo          OB Software 9.1  ENVIRONMENT

echo #

echo #

pause

:else

Open in new window

0
Comment
Question by:jkimzlg
3 Comments
 
LVL 10

Accepted Solution

by:
Jini Jose earned 250 total points
ID: 33526119
did u checked the local area connection name is same for all computers ?


0
 
LVL 3

Assisted Solution

by:VBDotNetCoder
VBDotNetCoder earned 250 total points
ID: 33526181
You must check the name as gmailjini: said.

Also the user account must have administrative rights to make that kind of a change on the OS.

What exactly is the error message?
0
 
LVL 3

Expert Comment

by:Guillermin-go
ID: 33539738
Hi:

    If the local area connection name is correct, ry this.

    At the end of line 9, add:

      index = 1
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup". After a while, you have entered a loop for Auto repair which does not fix anything and you will be in a  panic as all your work w…
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

758 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

24 Experts available now in Live!

Get 1:1 Help Now