Solved

using a batch file to change primary dns address

Posted on 2010-08-25
3
825 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Sometimes people don't understand why download speed shows differently for Windows than Linux.Specially, this article covers and shows the solution for throughput difference for Windows than a Linux machine. For this, I arranged a test scenario.I…
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

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