How do I enable my network connection using command prompt?

8,439

Solution 1

By using WMIC. Run the following with elevated/ administrator rights:

wmic path win32_networkadapter where index=7 call disable

where 7 is the network interface index number. You can find it by using:

wmic nic get name, index

http://itcookbook.net/blog/enabling-and-disabling-nics-commandline-windows

Solution 2

You have to run it with elevated/ admin privileges.

(@jfalcon's alternative approach is no different in that respect - it fails when run as non-privileged user and does not even understandably tell you so. (I edited their answer to reflect this.))

Share:
8,439

Related videos on Youtube

pabouk - Ukraine stay strong
Author by

pabouk - Ukraine stay strong

Updated on September 18, 2022

Comments

  • pabouk - Ukraine stay strong
    pabouk - Ukraine stay strong over 1 year

    How do I enable my network connection using command prompt?

    I've tried:

    netsh interface set interface "Local Area Connection" ENABLE
    

    But received this error:

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

    I know how to disable my network connection using ipconfig/release but when I try ipconfig/renew using command prompt it doesn't seem to be working either.

  • Shimmy Weitzhandler
    Shimmy Weitzhandler about 9 years
    Doesn't work for me.
  • Aaron Thoma
    Aaron Thoma almost 9 years
    @Shimmy, the fix is to run it with elevated/ admin privileges. (It hadn't worked for me either, even though it said Method execution successful.. It also said ReturnValue = 5;. When running it as admin, that ReturnValue changed to 0 and it worked.)