I would like to be able to make one or two desktop shortcuts that turn my Ethernet Adapter on and/or off

Darkmatterx

Distinguished
Apr 8, 2003
552
6
19,015
Hi, I would like to be able to make one or two desktop shortcuts that turn my Ethernet Adapter on and/or off.

If it could be one shortcut that I just had to double click (or set up a hotkey) to either turn my Ethernet Adapter on or off that would be great but I'd happily take two separate shortcuts or 2 shortcuts that each have to go to a batch file or whatever workaround that might be needed.

Thanks to anyone who can help!

DM
 
Apart from modifying network adapter properties from the Control Panel, you can also use the Command line tool to enable disable Network Interface Card.

Press Windows key + X, click Command Prompt (Admin).

In the elevated command prompt, copy and paste the command below, and press Enter. This will show you all network adapter names on your PC.
netsh interface show interface

To enable NIC type, the following command:
netsh interface set interface "network_adapter_name" admin=enable
(e.g netsh interface set interface "MyEthernet" admin=enable)

To disable NIC type, the following command:
netsh interface set interface "network_adapter_name" admin=disable
(e.g netsh interface set interface "MyEthernet" admin=disable)

Close the command prompt.

make a disnic.bat and enbnic.bat files on desktop and double click to activate make sure they run as admins though

REF: https://answers.microsoft.com/en-us/windows/forum/windows8_1-networking/script-to-disable-enable-network-interface/8eb15e24-7d85-4a16-b42a-a874b9bb3a28
 

gardenman

Splendid
Moderator
Taking the above info, you could do this in a single batch file. Use the batch file to create a .TXT file and if it exists, turn the adapater off and delete the .TXT file. If the file doesn't exist, turn it on and create the .TXT file. Example:

@echo off
if exist toggle.txt goto ITSON
goto ITSOFF

:ITSON
del toggle.txt
echo Turn it OFF here.
goto END

:ITSOFF
echo Hello > toggle.txt
echo Turn it ON here.
goto END

:END
pause