C
C#10mo ago
matcfs

How to store/show only ip settings of one ethernet device.

Hello, I'm stuck in this situation: my application must choose one ethernet device, change its ip configuration, do something and then restore previous configuration. It seems easy but after several tries I've no idea how to solve it. I tried to use
netsh interface dump > netcfg.dat
netsh interface dump > netcfg.dat
and then
netsh exec netcfg.dat
netsh exec netcfg.dat
with no avail. I'm thinking about a workaround to store only the ip configuration of that ethernet device but netsh show information of all ethernet devices (and unfortunately in my case are not few). Maybe the only solution is to store the output of netsh and then parse it ? (Ok but how? Regex?) My question for you is if there are any other solution to this problem? Sorry for the question, and thanks in advance.
2 Replies
matcfs
matcfsOP10mo ago
Thanks a lot, as usual I was looking in a totally wrong direction 🤦🏻‍♂️
Want results from more Discord servers?
Add your server