So, I have to set static ip's default gateways and WINS and dns and what not for a lot of windows systems both Windows 7 and XP soon. I made a batch script to help me using netsh. The problem is not every network interface name is the same. For the most part it is "Local Area Connection" but some are "Ethernet" or "Wireless Connection" and whatnot. So here is a line from my script:
netsh interface ip set address "Local Area Connection" static 192.168.%Range%.%IP_Last% 255.255.255.0 192.168.%Range%.1
Variables like %Range% are set earlier upon user input. Anyway, what I'm asking is how could I make it to where I could use:
netsh interface ip set address "%NIC_NAME%" static 192.168.%Range%.%IP_Last% 255.255.255.0 192.168.%Range%.1
So that it would work on any system. I just want it to use the currently active network card name. Thanks so much for any help!!