Welcome to my site. Please CLICK HERE to give your opinions regarding this new look of "PCTipsbyAnu". Thanks for visiting.

Friday, February 5, 2010

Browse » Home » , , , , , , » Change IP via batch (DOS)

Change IP via batch (DOS)



Is it possible to use IF/Els conditional script between DHCP and static changes?


Suppose: 
When I run my script it will look for value DHCP=YES then it will run static IP change scripts and when it will find the Value DHCP=NO it will run the DHCP set script. 



as an example:
=============
If DHCP = yes
then run Batch1


else skip


Batch1

netsh int IP set address "local area connection" static 192.168.1.12 255.255.255.0 192.168.1.1 1
netsh int ip set dns "local area connection" static 192.168.0.254 primary
netsh int ip set dns "local area connection" static 192.168.0.253 secondary
If DHCP = no
then run Batch2


Batch2
netsh int ip set address "local area connection" dhcp
netsh int ip set dns "local area connection" dhcp
===========================


something like that.


Is it possible. Would appreciate your help on this.
You can leave a response, or trackback from your own site.

About 'Anu': My name is 'Anu' also Known as 'ANU 007 TIGER' .I'm administrator of 'PC Tips by Anu' blog .This blog was opened for sharing contents about hacking n cracking.
Thanks YAHOO OR GMAIL

0 comments:

Post a Comment

 
Back to Top