Solved

using a batch file to change primary dns address

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

Is Your DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

Question has a verified solution.

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

Suggested Solutions

Issue: Unstable cursor in Windows XP and Windows runs extremely slow in that any click will bring up the Hour glass (sometimes for several seconds before giving you what you want) . Troubleshooting Process and the FINAL FIX: This issue see…
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

734 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