Ich habe diese BATCH für mein Notebook geschrieben, damit ich nicht jedesmal wenn ich unterwegs bin, meine IP-Adresse von Hand z.B. auf DHCP stellen muss und wieder auf statische. Diese BATCH spricht zwei Adapter an: "Drahtlose Netzwerkverbindung" und "LAN-Verbindung". Passt euch die Datei einfach so an, wie ihr sie braucht.

Netzwerk anpassen.bat

@ECHO OFF
CLS
ECHO.
ECHO ---- Netzwerk-Einstellungen anpassen ----
ECHO.
ECHO Bitte waehlen:
ECHO.
ECHO ===================
ECHO 1: WLAN: feste IP
ECHO 2: WLAN: DHCP
ECHO.
ECHO 3: LAN: Feste IP
ECHO 4: LAN: DHCP
ECHO.
ECHO 5: Abbrechen
ECHO ===================
ECHO.
ECHO. SET /p choice=

if '%choice%' == '5' goto Ende
if '%choice%' == '4' goto LAN_DHCP
if '%choice%' == '3' goto LAN_Statisch
if '%choice%' == '2' goto WLAN_DHCP
if '%choice%' == '1' goto WLAN_Statisch
Goto Ende

:WLAN_Statisch
ECHO.
ECHO IP-Adresse fuer "WLAN-Verbindung" statisch setzen...
ECHO =======================================================
ECHO.
netsh interface ip set address "Drahtlose Netzwerkverbindung" static 192.168.0.5 255.255.255.0 192.168.0.1 1
netsh interface ip set dns "Drahtlose Netzwerkverbindung" static 192.168.0.1
ECHO.
ECHO Einstellungen vorgenommen!
ECHO.
goto Ende

:WLAN_DHCP
ECHO.
ECHO IP-Adresse fuer "WLAN-Verbindung" per DHCP beziehen...
ECHO =======================================================
ECHO.
netsh interface ip set address "Drahtlose Netzwerkverbindung" dhcp
netsh interface ip set dns "Drahtlose Netzwerkverbindung" dhcp
ECHO.
ECHO Einstellungen vorgenommen!
ECHO.
goto Ende

:LAN_DHCP
ECHO.
ECHO IP-Adresse fuer "LAN-Verbindung" per DHCP beziehen...
ECHO =======================================================
ECHO.
netsh interface ip set address "LAN-Verbindung" dhcp
netsh interface ip set dns "LAN-Verbindung" dhcp
ECHO.
ECHO Einstellungen vorgenommen!
ECHO.
goto Ende

:LAN_Statisch
ECHO.
ECHO IP-Adresse fuer "LAN-Verbindung" statisch setzen...
ECHO =======================================================
ECHO.
netsh interface ip set address "LAN-Verbindung" static 192.168.0.6 255.255.255.0 192.168.0.1 1
netsh interface ip set dns "LAN-Verbindung" static 192.168.0.1
ECHO.
ECHO Einstellungen vorgenommen!
ECHO. Ende
ECHO Programm beendet
ECHO.
PAUSE