Quote:
Originally Posted by apalrd
You could just go Start->Run->type 'cmd' (usually already typed in since I almost certainly used it last) -> ipconfig /all
|
ipconfig /all shows interfaces I don't care about. I really wanted a way to just show basic interface information that doesn't make me hunt for the information.
Quote:
Originally Posted by apalrd
Same thing for the config. I used to write Batch and Perl scripts to do it, then I got lazy and just remembered the command to type ('netsh interface ipv4 set address "Local Area Connection" static 10.0.33.217 255.0.0.0'). Roughly the same number of mouse strokes (which are highly more time-consuming than keystrokes), especially if I don't have the folder with the batch file open or I'm not on my computer.
|
With using script to toggle between static and DHCP, I remove any errors that I may make with signaling what static IP I want(which avoids IP address conflicts), and it saves time and patience for me.
Quote:
Originally Posted by apalrd
My best solution is to just use WiFi only for real networks, and use wired Ethernet only for robot networks. But, in case I have to break this, then I can just type netsh and be done.
|
Sometimes my team needs the robot to be using the wireless network for increased mobility(although I do generally use wired for the static internet-lacking network and wireless for internet access), and I use my personal computer to work on the robot, so, at the end of the day, I don't want my wired interface to be set to a static IP.
Quote:
Originally Posted by apalrd
But, if you do still want to do it this way, it should be possible to do entirely in a shell script, reducing dependencies on a foreign machine to zero.
|
I opted for python over solely batch(thus not reducing the dependencies to zero) because batch makes simple things like storing the output of a program into a variable painful. I honestly tried to use only batch, but I couldn't bear using it after a point.
Quote:
Originally Posted by BigJ
Along with Andrew's info you should be able to achieve a toggling script by using an environment variable.
|
Using an environment variable sounds kind of hackish; the only way I could imagine being able to make a toggle of sorts would be to stuff practically a batch script into a variable that I execute. I really don't want to use the command-line directly to execute my program because then I would have to worry about editing the path variable to where I store the batch files, and I would need to run the prompt as administrator to change my IP, and I would need to type in the program name, as to apposed to just hitting the windows key once, the down arrow key, and then enter as I have it now.
The work is done; feel free to use it or not.