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

Posted on May 31st, 2008 by Donace 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: 9% [?]

Related posts:

  1. Beware the smiling man A few weeks ago I stumbled across some interesting spam; it was generic enough to make me think hmm is this spam or a...

No Comments

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

Archives

Full Archive

Tag Cloud

.htaccess adgitize Alexa Internet automation Backlink Backlinks Blog bot Bots code competitons Contest copyright entrecard Firefox Google Google Page Rank How to howto Law link building Link Love links news Optimization PageRank PHP plugin Programming Promotion Rants of a loony toon rapidshare Search Engines Security SEO Site update Site updates Spammers TheDuke traffic tutorial updates Weblogs Webmaster Web traffic