How to disable Local area connection with a command?

G

Guest

I'm using a WinXP Pro sp2 desktop. I want to disable the Local area
connection with a command line command, just as what we do by right clicking
Local Area Connection icon in the Network Connections panel and select
'Disable'.

But I don't know which command to use, it seems 'net stop netman' doesn't
work.
 
A

allan_grossman

WXB said:
I'm using a WinXP Pro sp2 desktop. I want to disable the Local area
connection with a command line command, just as what we do by right clicking
Local Area Connection icon in the Network Connections panel and select
'Disable'.

But I don't know which command to use, it seems 'net stop netman' doesn't
work.

Hi -

I'm not sure exactly what you're trying to accomplish, but not all
internal services are supported by 'net stop' - as you've apparently
found out ;-)

'net stop server' and 'net stop workstation' will stop resource sharing
and access of shared resources, respectively. If you're looking to
disable the NIC itself, what you need to download and install devcon.
Look here -

http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q311272

Hope this helps -
 
S

Steve Winograd [MVP]

WXB said:
I'm using a WinXP Pro sp2 desktop. I want to disable the Local area
connection with a command line command, just as what we do by right clicking
Local Area Connection icon in the Network Connections panel and select
'Disable'.

But I don't know which command to use, it seems 'net stop netman' doesn't
work.

This isn't the same as right-clicking and disabling the connection,
but it might accomplish the same purpose.

If the local area connection gets its IP address from a DHCP server,
this command will release the IP address, stopping all network access:

ipconfig /release "Local Area Connection"

To resume network access:

ipconfig /renew "Local Area Connection"

I'm looking for a way to disable a connection using the "netsh"
command, but I haven't found anything so far.
--
Best Wishes,
Steve Winograd, MS-MVP (Windows Networking)

Please post any reply as a follow-up message in the news group
for everyone to see. I'm sorry, but I don't answer questions
addressed directly to me in E-mail or news groups.

Microsoft Most Valuable Professional Program
http://mvp.support.microsoft.com
 
G

Guest

'net stop server' and 'net stop workstation' will stop resource sharing
and access of shared resources, respectively. If you're looking to
disable the NIC itself, what you need to download and install devcon.
Look here -

http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q311272

Hope this helps -

Thank you allan_grossman, devcon helped me most but not all :-(

I have an app that detects the network connection on the computer. When I
disable Local Area Connection from the 'Network Connections' panel,
everything is OK, the app can't detect the network connection, and the
process is repeatable.

The first time I disabled NIC with devcon, the app responsed correctly -- it
can't detect the network. But when I enabed and then disabled NIC again, the
app failed to work -- it believes the network connection is still there.

It seems Disable/Enable LAN from Network Connections pannel is doing more
work than just Disable/Enable NIC driver.
 
G

Guest

If the local area connection gets its IP address from a DHCP server,
this command will release the IP address, stopping all network access:

ipconfig /release "Local Area Connection"

To resume network access:

ipconfig /renew "Local Area Connection"

Thank you Steve, but it didn't answer my question. :-(
'devcon' mentioned by allan_grossman in the previous post helped much.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top