enable/disable all network connections using cmd

Answered enable/disable all network connections using cmd

  • 2012年2月25日 上午 10:21
     
      包含代碼

    Hi,

      I want to refresh my local area connection using cmd. It is acheived using "netsh interface set interface "Local Area Connection" disable" & "netsh interface set interface "Local Area Connection" enable". But what to do if I dnt know the name of Connection.

    Which command to use to disable/enable all network connection.

    Thanx ...


    Vipin Tyagi (MCSE 2003) Windows Admin

    • 已變更類型 Abhay Tyagi 2012年2月25日 上午 10:59
    •  

所有回覆

  • 2012年2月25日 上午 10:46
     
     已答覆 包含代碼

    Assuming you want to disable all physical network adapters in your computer you can use these commands:

    Disable:
    wmic path win32_networkadapter where PhysicalAdapter=True call disable
    
    Enable:
    wmic path win32_networkadapter where PhysicalAdapter=True call enable

    • 已標示為解答 Abhay Tyagi 2012年2月25日 上午 10:59
    • 已取消標示為解答 Abhay Tyagi 2012年3月5日 上午 11:02
    • 已標示為解答 Abhay Tyagi 2012年4月26日 上午 08:45
    •  
  • 2012年3月5日 上午 11:02
     
     

    Thanks Jaap Brasser,

     It worked but also can you please tell me the command that can run on Windows XP SP2 Professional for the same issue.

    Thanks in advance ....


    Vipin Tyagi (MCSE 2003) Windows Admin

  • 2012年3月5日 下午 01:14
     
     

    You can use the devcon utility for this in Windows XP. You can find more information about it here:

    The DevCon command-line utility functions as an alternative to Device Manager