I tried it and it gave me the following error:
static is not an acceptable value for addr.
Here is the bat file that I have created:
@ECHO OFF
CLS
:LOOP
ECHO =========PULIZ IP Address Changer==========
ECHO.
ECHO 1. Home
ECHO 2. Office
ECHO Q. Quit
ECHO.
:: SET /P prompts for input and sets the variable
:: to whatever the user types
SET Choice=
SET /P Choice=Type the number and press Enter:
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
IF NOT '%Choice%'=='' SET Choice=%Choice:~0,1%
ECHO.
:: /I makes the IF comparison case-insensitive
IF /I '%Choice%'=='1' GOTO ItemA
IF /I '%Choice%'=='2' GOTO ItemB
IF /I '%Choice%'=='Q' GOTO End
ECHO "%Choice%" is not valid. Please try again.
ECHO.
GOTO Loop
:ItemA
netsh interface ip set address "Local Area Connection" dhcp
netsh interface ip set dns "Local Area Connection"
source=dhcp
GOTO End
:ItemB
netsh interface ip set address "Local Area Connection"
static 192.168.1.24 255.255.255.0 192.168.1.253 1
netsh interface ip set dns "Local Area Connection" static
64.42.64.5
netsh interface ip add dns "Local Area Connection" static
64.42.65.1
GOTO End
PAUSE
CLS
GOTO Loop
:End
ECHO Ip Address Changed
PAUSE
exit
Take a look and see if it is something I did.
THanks a lot!
Scott
>-----Original Message-----
>
>>-----Original Message-----
>>I know there is a way to change from DHCP to static and
>>back, but can I not add a secondary DNS server using
>NetSh?
>>
>>Thanks!
>>
>>Scott
>>.
>Hi Scott,
>
>use this syntax:
>Primary
>"netsh interface ip set dns Lan-Verbindung static
>10.178.66.6"
>secondary
>"netsh interface ip add dns Lan-Verbindung 10.178.66.14"
>
>Greets, Frank
>.
>
|