Answer the question
In order to leave comments, you need to log in
How to get the current network via bat?
I am writing a program on one ancient platform, in which there is no support for such simple things as, for example, getting the current network.
Briefly what I need.
Through bat, get the Internet network to which the PC is connected.
And output it to a separate file.
Something like this:
ECHO Request current network
WRITE activenet.txt
Answer the question
In order to leave comments, you need to log in
Here is the request and writing to the file:
netsh interface show interface > net.txt
Request only the connected interface (but will only work in OS with the Russian interface language):
netsh interface show interface | find /i "Подключен" > net.txt
wmic.exe nic where "NetConnectionStatus=2" get NetConnectionID |more +1 > net.txt
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question