Disabling and Enabling network connections using CLI

Hello Everyone, I want to disable and enable the wired connection (ethernet adapter) in my laptop though command prompt. I am trying to use PEAP using windows XP 802. 1x client for user authentication and in some cases, the user will like to enter a different username and password.

Windows Networking 2246 This topic was started by ,


data/avatar/default/avatar17.webp

5 Posts
Location -
Joined 2004-10-19
Hello Everyone,
 
I want to disable and enable the wired connection (ethernet adapter) in my laptop though command prompt. I am trying to use PEAP using windows XP 802.1x client for user authentication and in some cases, the user will like to enter a different username and password. The 802.1x client in windows prompts for the username and password only when you take out the cable or disable and enable the ethernet connection.
 
So if anyone can tell me how can i disable and enable a specific interface in windows xp using the command line interface, I will be greatful.
 
Regards
 
Khurram

Participate on our website and join the conversation

You have already an account on our website? Use the link below to login.
Login
Create a new user account. Registration is free and takes only a few seconds.
Register
This topic is archived. New comments cannot be posted and votes cannot be cast.

Responses to this topic


data/avatar/default/avatar19.webp

3857 Posts
Location -
Joined 2000-03-29
Check out
Quote:netsh /? and
Quote:netsh interface /?

data/avatar/default/avatar17.webp

5 Posts
Location -
Joined 2004-10-19
OP
Hi,
 
I tried netsh and netsh interface but I could not find any command in that which disables or enables a specific interface. Mostly the commands are to set the parameters for an interface.

data/avatar/default/avatar19.webp

3857 Posts
Location -
Joined 2000-03-29
And if you drill down further in the help in "set", you will notice some more commands. Eventually, you would come up with something like:
 

Quote:netsh interface set interface name="Local Area Connection" admin=ENABLED

data/avatar/default/avatar17.webp

5 Posts
Location -
Joined 2004-10-19
OP
Hi clutch
 
Thanks for your reply.
 
I tried this command
 
netsh interface set interface name="Local Area Connection" admin=ENABLED
 
But I get the following message
 
One or more essential parameters not specified
The syntax supplied for this command is not valid. Check help for correct syntax.
 
But if I try the following command, it works and the name of the interface is changed,
netsh interface set interface name="Local Area Connection" newname=LAN1
 
There is one more thing that it says in the help,
 
admin - whether the interface should be enabled <non-LAN only>.
 
But for newname it says,
 
newname - new name for the interface <LAN only>
 
I wonder does it mean that I can disable or enable only the logical interfaces and not the physical ones and can change the name for physical ones (as it worked for me)
 
Thanks again for your help and time. I highly appreciate this.
 
Khurram
[Edited by khurram on 2004-10-20 06:05:37]
 

data/avatar/default/avatar17.webp

5 Posts
Location -
Joined 2004-10-19
OP
thanks alot for replying again clutch. actually i want to make things easier for the end user .. and in case of devcon, they have to install a tool and then u can run the batch file containing commands to disbale or enable the lan ..
 
i wonder if there is any other way in windows XP and 2000 that user is prompted by 802.1x client to login the username and password useing PEAP ... i could trigger that login only when I take out the cable from LAN or when I disable it and then enable it again ..
 
regards
 
khurram

data/avatar/default/avatar28.webp

1 Posts
Location -
Joined 2006-06-01
Enabling:
 
netsh interface set interface "Local Area Connection " ENABLE
 
 
Disabling:
 
netsh interface set interface "Local Area Connection " DISABLE
 
 
Ratnesh