Solved

using a batch file to change primary dns address

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

The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Error login w2012 domain 6 98
How does Redux fit into React? 3 84
Rename all files in a directory to numerical order 26 30
AWK: Pythagoras script 6 22
It is only natural that we all want our PCs to be in good working order, improved system performance, so that is exactly how programs are advertised to entice. They say things like:            •      PC crashes? Get registry cleaner to repair it!    …
Utilizing an array to gracefully append to a list of EmailAddresses
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

860 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