Computing.Net > Forums > Programming > One Click IP Change by Batch Progrm

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

One Click IP Change by Batch Progrm

Reply to Message Icon

Name: dhavalcoholic
Date: November 16, 2008 at 21:12:02 Pacific
OS: Win XP
CPU/Ram: 512
Product: Intel
Comment:

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~~




Sponsored Link
Ads by Google

Response Number 1
Name: tonysathre
Date: November 16, 2008 at 21:29:03 Pacific
Reply:

Get rid of the pipe.


0

Response Number 2
Name: dhavalcoholic
Date: November 16, 2008 at 21:33:28 Pacific
Reply:

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~~


0

Response Number 3
Name: dhavalcoholic
Date: November 16, 2008 at 21:41:20 Pacific
Reply:

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.1

none


:: 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~~


0

Response Number 4
Name: dhavalcoholic
Date: November 16, 2008 at 21:51:36 Pacific
Reply:

Another Small Question if u dont mind ;)


I managed to change the Preffered DNS.

But can we change the Alternate DNS ???

ThaxXx!! :)

~~Psychedelic~~


0

Response Number 5
Name: Holla
Date: November 16, 2008 at 22:20:36 Pacific
Reply:

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.


0

Related Posts

See More



Response Number 6
Name: dhavalcoholic
Date: November 17, 2008 at 09:07:31 Pacific
Reply:

Thanx Holla :)

~~Psychedelic~~


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: One Click IP Change by Batch Progrm

Windows Message when ip changes www.computing.net/answers/programming/windows-message-when-ip-changes/8371.html

Ip address in Batch Files www.computing.net/answers/programming/ip-address-in-batch-files/6571.html

Registry change in batch file www.computing.net/answers/programming/registry-change-in-batch-file/13932.html