Solved

using a batch file to change primary dns address

Posted on 2010-08-25
3
826 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Background Still having to process all these year-end "csv" files received from all these sources (including Government entities), sometimes we have the need to examine the contents due to data error, etc... As a "Unix" shop, our only readily …
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

623 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