4 Responses to “Batch file to get TCP/IP info from local LAN”

John Wagnersaid

If you loop this thing, you need to enable delayed Expansion. Otherwise your for next loops, and if statements can get messed up. I wonder why this is even an option! (This is an issue for bat files, NOT power shell and vbs.) I also dumped this to a file and I added a date time stamp to the file. Please note that Delayed Expansion behaves differently depending on the OS. This works in Windows 7. There is a programmer somewhere that needs slapped for sheer awkardness!

John Wagnersaid

This subnet mask and gateway query script did not run quite right for me. I changed the goto:exit to goto:eof in the subroutines so both of them would run and not exit after the first success. Without this change only the subnet mask was returned.