using a batch file to change primary dns address

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

LVL 1
jkimzlgAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Jini JoseConnect With a Mentor Senior .Net DeveloperCommented:
did u checked the local area connection name is same for all computers ?


0
 
VBDotNetCoderConnect With a Mentor Commented:
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
 
Guillermo FeijóoSystems administratorCommented:
Hi:

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

    At the end of line 9, add:

      index = 1
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.