Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hie,
I want to make a Batch Program to change IP addresses & DNS address.
I could do it through Command Prompt.
But those commands are not working in .BAT files ! :(
The command for changing DNS is working fine... but the command for changing IP addresses is not working.
http://i250.photobucket.com/albums/...
Please check this image.
Please Help !! :(
~~Psychedelic~~
I dint get you Sir.
In .BAT files.....
If i remove " |none " i am asked to check the code again by the Command Prompt.
While if i use it, i get " 'none' is not internal or external command" message.
Should i remove only the pipes " | " or " |none" ??
thanx a lott for ur reply ! :)~~Psychedelic~~
Report Offensive Follow Up For Removal
Bingo !!
I Removed only " | " and now the following program is working Fine !! Woooooo !!
<Code starts>
netsh interface ip set address "Local Area Connection" static 1.2.3.4 255.255.255.0 1.2.3.1none
:: dis wil change the Preffered DNS.....netsh interface ip set dns "Local Area Connection" static 5.6.7.8
<code ends>
Thanx a lott Tony ! :)~~Psychedelic~~
Report Offensive Follow Up For Removal
Another Small Question if u dont mind ;)
I managed to change the Preffered DNS.But can we change the Alternate DNS ???
ThaxXx!! :)
~~Psychedelic~~
Report Offensive Follow Up For Removal
dhavalcoholic,
netsh interface ip add dns "Local Area Connection" ip.ad.dr.ess index=2- Will add the given address to dns list.
If you already have an alternate dns, the above command will note change it, instead you will have 3 dns.
The command to remove a dns from the list is
netsh interface ip del dns "Local Area Connection" address=ip.ad.dr.ess--
Holla.
Report Offensive Follow Up For Removal
![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |