Jump to content

[Closed] How to Start and Stop a Network Connection?


Zohar
 Share

Recommended Posts

Hi

 

I am using Windows XP SP3,

and I have a Network Connection called "Local Area Network" that represents my Ethernet NIC.

How can I Start and Stop this connection, via AutoIt?

 

Thank you

Edited by Zohar
Link to comment
Share on other sites

 I've got an old thread with a script that may work with Windows XP still.  You are welcome to check it out to get some ideas.
https://www.autoitscript.com/forum/topic/52886-quicknic/

I believe you can also use the netsh command line utility to enable and/or disable a network interface.
 

Also, just a comment...Windows XP? 
*shivers  It's Highly vulnerable. 
nothing personal....just the computer security side of me freaking out

 

Link to comment
Share on other sites

Thank you spudw2k

 

In addition to the vbScript, are there other options?

The Shell option doesn't work, because it seems it accepts Enabling/Disabling all network connections except the LAN one..

Edited by Zohar
Link to comment
Share on other sites

Thank you, but as written before,

the netsh option works on all items except the "Local Area Connection" item..

(it also writes it in the help for netsh)

 

I don't know why they decided to exclude the "Local Area Network" item from all the rest..

 

See this screenshot:

http://s1.postimg.org/854xb8t3j/netsh.png

Edited by Zohar
Link to comment
Share on other sites

Also, you can use my Network configuration UDF : https://www.autoitscript.com/forum/topic/155539-network-configuration-udf/

#RequireAdmin

#Include "network.au3"

_DisableNetAdapter("Local Area Network")
; or
_EnableNetAdapter("Local Area Network")

 

Link to comment
Share on other sites

you only ran "netsh interface set interface"

No, I ran both commands :)

The shorter one was just to show what the help says, regarding not allowing changing the state of the LAN connection, for some reason that they have..

Here's the full command's result:

full.png

 

jguinch:
Thank you very much, interesting to find another method..

Edited by Zohar
Link to comment
Share on other sites

... could you try this:

within a cmd prompt run as administrator type:

netsh interface show interface

above command should show you the exact name of your interface(s)

now type this command:

netsh interface set interface "Local Area Network" disabled

where the name of the interface must be exactly like shown in previous show interface command.

(in your command in post #13 you typed disable instead of disabled (you missed the last d)

Edited by Chimp

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Link to comment
Share on other sites

... could you try this:

within a cmd prompt run as administrator type:

netsh interface show interface

above command should show you the exact name of your interface(s)

now type this command:

netsh interface set interface "Local Area Network" disabled

where the name of the interface must be exactly like shown in previous show interface command.

(in your command in post #13 you typed disable instead of disabled (you missed the last d)

Regarding the interface names - yes I am complately aware of it, and I used the correct name.

If I try to write an incorrect name, I get

"An interface with this name is not registered with the router."

 

And If I try with the correct name, then it simply shows me the help again.

(probably to remind me that the LAN interface cannot be worked on - see the screenshot:  http://s1.postimg.org/854xb8t3j/netsh.png )

 

Also, I tried again with disabled, and no change unfortunately..

 

The netsh commands definitely work, I've tried them before on windows 10 and windows 7.

Maybe this exclusion of the LAN interface is only in Windows XP?

Because it really doesn't work here..

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...