Re: How to disable and enable my Local Area Connection using scripts



On Mar 31, 9:02 am, "M Shafaat" <pop...@xxxxxxxxx> wrote:
Hi,
I wish to disable and enable my Local Area Connection using scripts. Can
anyone suggest a very simple script or command line using netsh etc for
doing this?

My main objective is to prevent virus attacks from the Internet when the
machine is idle by disconnetcting my PC from the home network.

Best regards,
M Shafaat

Which is most important? dis- and re-enabling your connection? or
doing so only when the computer is "idle"? The former is relatively
simple and can be done using a variety of scripting techniques, or
even batch files. I imagine the latter would not be terribly
difficult (to some) either.

I would think the most straight forward way would be to script an
event sink that is triggered by the screen saver. (not personally sure
exactly how to do that, but I've seen event triggered actions
before). when the screen saver fires, the event sink would trigger
the function to disable/re-enable the internet connection. A caveat
would be that this would require the/a screen saver to be used. This
would also allow the screen saver timeout to 'control' the actions of
the connection dis-/re-enabler.

If you are not running/able to run a screen saver, or want to define
conditions other than what would trigger the screen saver... I'm sure
it's possible, but currently out of my skill set.
.