Answer the question
In order to leave comments, you need to log in
Where can I get the automatic on / off program and network adapter settings?
Where can I get a ready-made solution (or how to write my own in CMD/PowerShell/Java/Python at minimal cost)
so that it does:
A specific IP was constantly pinged.
As soon as the ping disappears: turn off the adapter, turn on the adapter, set the IP on the adapter statically.
I know the commands netsh interface ip set address
, netsh interface set interface
.
Answer the question
In order to leave comments, you need to log in
@echo off
:loop
ping -n 1 ya.ru || (
netsh interface set interface "Ethernet" admin=DISABLED
netsh interface set interface "Ethernet" admin=ENABLED
netsh interface ipv4 set address "Ethernet" static 10.0.0.1 255.255.255.0 10.0.0.2
exit
)
timeout 1
goto loop
Usually system scripts are used for this. On CMD/PS this can be done quickly.
A strange task was set, in connection with which this was needed?
At the price of PCI setevukha 300 rubles - to start all this trouble???!!!
There is an example script in Powershell/CMD: blogs.technet.com/b/heyscriptingguy/archive/2014/0...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question