View Single Post
  #1   Spotlight this post!  
Unread 17-01-2009, 17:31
DtD's Avatar
DtD DtD is offline
I hope the watchdog starves!
AKA: Pathogen David
FRC #2410 (The Metal Mustangs (Merged from 2334, Hazmat Robotics))
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2008
Location: Kansas
Posts: 86
DtD will become famous soon enoughDtD will become famous soon enough
Batch files to switch between DHCP and Static IP

I made these batch files to switch between Static IP and DHCP in Windows. I use them because I use my laptop's Wireless at school, and wired to program our robot, but at home I use the Wired.

To use them, just paste the commands in notepad and save as a .bat (EG: "cRIO Mode.bat" or "Internet Mode.bat")

cRIO / Static IP Mode:
Code:
@echo off
netsh interface ip set address name="Local Area Connection" static 10.23.34.6 255.0.0.0 10.23.34.4 1
pause
NOTE: You need to change the addresses to your team number. We are 10.23.34.*, but you probably aren't!

DHCP Mode:
Code:
@echo off
netsh interface ip set address "Local Area Connection" dhcp
pause
~DtD
PS> If you typically use a static IP when not talking to your robot, and you need to configure DNS servers too, then use these commands:
Code:
netsh interface ip set dns "Local Area Connection" static 208.67.222.222
netsh interface ip add dns "Local Area Connection" 208.67.220.220 index=2
That sets it to use OpenDNS...