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.
.



Relevant Pages

  • Re: How to disable and enable my Local Area Connection using scripts
    ... I mostly prefer to write a script that "programmatically" performs exactly ... I wish to disable and enable my Local Area Connection using scripts. ... event sink that is triggered by the screen saver. ... conditions other than what would trigger the screen saver... ...
    (microsoft.public.scripting.vbscript)
  • Re: dialup solution (as seconary connection / iptables )
    ... ip-down is launched by pppd only after the PPP link no longer available ... first with MINICOM or is PAP and script not mutualy exclusive? ... do have to "make the connection first with MINICOM." ... If you use the Linux box and route the news IP address to it on each ...
    (comp.os.linux.networking)
  • Re: mysqli connections and oop
    ... need to do all processing in a script before I display a page that will ... But it will most probably NOT terminated the execution of the script. ... this means that NO lasting connection is build ... Why does it not carry the mysqli connection? ...
    (comp.lang.php)
  • Re: mysqli connections and oop
    ... And here is the script that execute this ... lose a mysqli connection upon the reload of the page? ...
    (comp.lang.php)
  • Re: Does apache stop a script mid execution ?
    ... If the user calls a time consuming script and then stops or refreshes ... How does it relate to e.g. a script performing a large mysql query? ... 2.b) how the connection is set up. ... the server stops the script execution. ...
    (comp.lang.php)