How to Switch Between Static And DHCP Wireless I.P. By Wolfclaw

Posted on May 31st, 2008 by in Computer, How to

Simple little batch file to assign a static
i.p to your wireless adapter when on your home network and a DHCP
i.p when connecting to other networks, for example BT Openzone
hotspot.

Copy code into notepad and save as “network.bat”, make sure it is
saved as ANSI encoding.

I haven’t included the “PICK” program, you can use your own
favourite dos based choice program and change the errorlevel
commands to suit.

Copy all Below till ‘exit’


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
@echo off
title Wireless Network Configuration
echo.
echo.
echo.
echo               ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
echo               ³       Select Wireless Network Configuration      ³
echo               ³                                                  ³
echo               ³   1. Static Address For Home Network             ³
echo               ³                                                  ³
echo               ³   2. DHCP Address For Other Networks             ³
echo               ³                                                  ³
echo               ³   3. Exit                                        ³
echo               ³                                                  ³
echo               ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
pick 1 2 3
if errorlevel 3 goto end_it
if errorlevel 2 goto dhcp_ip
if errorlevel 1 goto static_ip
:static_ip
cls
echo.
echo.
echo.
echo               ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
echo               ³                                                  ³
echo               ³           Wireless Network Configuration         ³
echo               ³                                                  ³
echo               ³     Applying Static Address For Home Network     ³         
echo               ³                                                  ³
echo               ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
echo.
netsh interface ip set address name="Wireless Network Connection" static 10.0.0.7 255.255.255.0 10.0.0.1 10.0.0.1
netsh interface ip add dns name="Wireless Network Connection" addr=10.0.0.1
goto end_it
:dhcp_ip
cls
echo.
echo.
echo.
echo               ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
echo               ³                                                  ³
echo               ³           Wireless Network Configuration         ³
echo               ³                                                  ³
echo               ³     Applying DHCP Address For Other Networks     ³         
echo               ³                                                  ³
echo               ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
echo.
netsh interface ip set address name="Wireless Network Connection" dhcp
netsh interface ip set dns name="Wireless Network Connection" dhcp
:end_it
exit

Popularity: 8% [?]

No related posts.

No Comments

(A must)
(Another Must but dont worry will not be published)

Disclaimer

All opinions are the authors own and any legal topics should not be relied upon exclusively and own legal counsel should be sought. Affiliate links are used on this site please see our Privacy Policy

This Site is Sponsored by Power of Attorney

My Everest – Ranking Update

My Everest Quest involved getting ranked for Hostgator coupon and Hostgator Promo Code.

Ranking 15th Jan Start - Unranked
Ranking Q1 #18

Copyright © 2007 – 2012 The Nexus All rights reserved