

InterviewSolution
1. |
Solve : batch file for ipconfig + ping results? |
Answer» Hi guys!! Are you looking to ping the entire subnet? I was really just looking to ping 2 or 3 IP addresses on the network. Quote from: bwilcutt on February 16, 2012, 04:15:43 PM
I was hoping to stick to the .bat thing because that's the only bit of programming I'm even remotely familiar with, but I'm definitely open to whatever will work best. Quote from: bwilcutt on February 16, 2012, 04:15:43 PM Also... Sorry I think I explained this badly! A lot of my day in the near future will be spent calling clients to determine if their local area network is setup for DHCP or Static IP addresses. If static, I'll have to gather their network's Gateway, Subnet, and DNS #s and find an available IP address that we can assign to a device that we'll be shipping them. What I normally have them do over the phone is open cmd, run ipconfig/all then ping xxx.xxx.xxx.250 (since .250 is usually available on most of these NETWORKS) they read me the results and I have everything I need. Since most of what I do is contained on the cmd prompt, I was thinking it would be much easier to have a .bat script (or something) that I could just email them to open, that would gather all of this info in a text file that they could shoot back to me. The problem I was running into is the fact that some of the IP addresses of different customers are 192.168.1.x, 10.100.1.x, etc... and I wasn't sure how to get the .bat to ping whatever set of numbers was listed previously by ipconfig I'm sure there's a more efficient way of doing this, but I guess that's the best way I know. I really appreciate the help! You can isolate output lines from ipconfig /all using the FIND command. Example: ipconfig /all | find "Default Gateway" Then you can use FOR to parse the line to get an IP address and extract the octets and use the first three plus your selected final one in a ping command. Perhaps if you state which line(es) from the ipconfig /all output contains the IP address(es) you wish to use, a simple script can be written. So more information please. Quote from: CassieXoXo on February 17, 2012, 02:52:10 PM A lot of my day in the near future will be spent calling clients to determine if their local area network is setup for DHCP or Static IP addresses. If static, I'll have to gather their network's Gateway, Subnet, and DNS #s and find an available IP address that we can assign to a device that we'll be shipping them.Do you realize there could be both on the network. That is how most networks are setup in the first place. The DHCP server is setup with a range of IP addresses that it can give out to clients that request an IP address. This is called a POOL. One of the reasons for the pool is to maintain control of the network so that other devices like, routers, switches and servers can be allocated static IP addresses that the DHCP server is not stepping on. If you are doing support for your clients networks I would suggest you get a better handle on how their networks are configured by asking them if they know how the network is configured or if they have documentation on how the network was configured. Better yet it would only take a few seconds to remote into their computer as well. You could just ask them to remote into their computer and do your voodoo and be done. Quote from: Squashman on February 18, 2012, 06:33:06 AM Do you realize there could be both on the network. That is how most networks are setup in the first place. The DHCP server is setup with a range of IP addresses that it can give out to clients that request an IP address. This is called a POOL. One of the reasons for the pool is to maintain control of the network so that other devices like, routers, switches and servers can be allocated static IP addresses that the DHCP server is not stepping on. Yes, I realize that many networks are setup that way. However, with many of the networks I'm dealing with, DHCP is disabled altogether. In the somewhat rare case that DHCP is enabled, their network uses .1-.250. Quote from: Salmon Trout on February 18, 2012, 02:47:26 AM You can isolate output lines from ipconfig /all using the FIND command. Example: I was thinking something like the FOR command would work, but I was having difficulty specifying the variables. As I wrote, Quote Perhaps if you state which line(es) from the ipconfig /all output contains the IP address(es) you wish to use, a simple script can be written. So more information please. |
|