# How do I turn off ethernet connection and use Wifi?



## OM2 (Oct 28, 2007)

I have my laptop connected to ethernet

How do I turn off the ethernet connection and use Wifi?

I'm being lazy and don't want to unplug the ethernet cable 

Is there a DOS script I can use to switch on and off?

Thanks


----------



## LIS333 (Dec 2, 2016)

There are at least 6 different ways to accomplish this, but since you want the easiest way, I recommend you unplug the cable. 


Sent from my iPhone using Tapatalk


----------



## OM2 (Oct 28, 2007)

LIS333 said:


> There are at least 6 different ways to accomplish this, but since you want the easiest way, I recommend you unplug the cable.
> 
> Sent from my iPhone using Tapatalk


>> I'm being lazy and don't want to unplug the ethernet cable 
that's what i said

so give me the other 5 ways


----------



## LIS333 (Dec 2, 2016)

Go to adapter settings, right click the Ethernet adapter and select disable. 


Sent from my iPhone using Tapatalk


----------



## managed (May 24, 2003)

LIS333 said:


> Go to adapter settings, right click the Ethernet adapter and select disable.
> 
> Sent from my iPhone using Tapatalk


Then unplug the ethernet cable !


----------



## flavallee (May 12, 2002)

LIS333 said:


> There are at least 6 different ways to accomplish this, but since you want the easiest way, I recommend you unplug the cable.
> Go to adapter settings, right click the Ethernet adapter and select disable.


Since that's more time-consuming than it is to unplug the ethernet cable, don't hold your breath. 

-------------------------------------------------------------


----------



## LIS333 (Dec 2, 2016)

Yeah. I suggested that but I guess the sarcasm was to subtle. I don't like to be condescending. 


Sent from my iPhone using Tapatalk


----------



## OM2 (Oct 28, 2007)

thanks for the replies guys.
i think i'd now prefer a command line execution to turn on and off
any ideas?

u guys are right - not worth the bother 
one too many mouse clicks


----------



## TerryNet (Mar 23, 2005)

Probably the netsh command can do as you want.

For my curiosity, why go to any trouble to use wireless when you are already connected by ethernet and, apparently, do not intend to move the computer?


----------



## OM2 (Oct 28, 2007)

IP addresses
I need to be logged in with another IP to test code i am having developed.
so i have a mobile wifi dongle. i can connect to it - but then still i am connected by ethernet.
the switch over by unplugging is painful - takes 2-3 minutes.

netsh - seen the code i need. just condering how to automate and have a single batch file that opens in admin just by being clicked?


----------



## jenae (Mar 17, 2013)

Hi, well it's probably best if you get used to powershell , on my machine I can turn on or off any connection using an elevated powershell command (run powershell as admin).

To find all your connections at the prompt type:- get-netadapter (press enter) Note what it says under "Name" in my case very simple "ethernet" for one and "wifi" for the other. Now to disable ethernet, type:-

Get-NetAdapter -Name ethernet* | Disable-NetAdapter (press enter), you will be prompted to confirm, press Y and enter.

To enable type:-

Get-NetAdapter -Name ethernet* | Enable-NetAdapter (press enter) you are not prompted the connection is simply enabled.

It is possible to run this without a confirm prompt, the cmdlet is different.. not needed here.

EDIT:- just read your last post to run without a confirm prompt:-

Disable-NetAdapter -Name ethernet -Confirm:$false

Enable-NetAdapter -Name ethernet -Confirm:$false


----------



## OM2 (Oct 28, 2007)

never used powershell 
is that a superior thing to DOS?


----------



## jenae (Mar 17, 2013)

Hi, well yes it is, MS are slowly deprecating command.exe in favour of powershell, which still contains the old command.exe (to invoke cmd in powershell simply type cmd.exe, press enter)

Powershell has been around for a long time the latest v5 is integrated into windows ten.

It provides much greater control over the windows shell and is very useful for forum type solutions, takes some getting used to, as did DOS when you see it for the first time. However when I use it on forums (such as this one) all the thread starter usually has to do is copy and paste (even this has changed, with PS you can copy text and right click anywhere in the PS window and the text will append to the prompt, I always run PS as admin).

I strongly urge all of you to start using it, many of the questions asked here have powershell solutions.

Here is a brief explanation:-

http://www.digitalcitizen.life/simple-questions-what-powershell-what-can-you-do-it


----------

