I want to make a batch file that constantly checks within a few seconds or minutes if the VPN connection on my PC goes offline, and if it does, I want it to disable the internet connection temporarily until the VPN goes back online or reconnects or if I just reconnect to the network myself.
Keeping a cmd window just constantly waiting for a vpn connection to go offline to cut off my internet connection may be annoying, so I know what to do. Just make the batch window run invisibly with a vbs file which is what I always do if I want to run a batch file invisibly
So really all I want is a batch file that constantly checks if the vpn adapter has a status of connected or disconnected, and if it gets disconnected, it disables my internet connection, setting it to limited or what not, unless I reconnect my vpn or just connect my network connection manually again myself.
Pretty much doing something like this:
@echo off
:loop
timeout 4 >nul
"Command checking the status of the vpn adapter here"
"commands for what to do if the status is disconnected" goto disable
: disable
"commands to disable the internet connection"
"commands for what to do if the status is connected" goto okconnection
:connection
goto loop
you know, something like that.
So if anyone knows how to do this, please let me know, thanks
Keeping a cmd window just constantly waiting for a vpn connection to go offline to cut off my internet connection may be annoying, so I know what to do. Just make the batch window run invisibly with a vbs file which is what I always do if I want to run a batch file invisibly
So really all I want is a batch file that constantly checks if the vpn adapter has a status of connected or disconnected, and if it gets disconnected, it disables my internet connection, setting it to limited or what not, unless I reconnect my vpn or just connect my network connection manually again myself.
Pretty much doing something like this:
@echo off
:loop
timeout 4 >nul
"Command checking the status of the vpn adapter here"
"commands for what to do if the status is disconnected" goto disable
: disable
"commands to disable the internet connection"
"commands for what to do if the status is connected" goto okconnection
:connection
goto loop
you know, something like that.
So if anyone knows how to do this, please let me know, thanks