Quick On/Off Buttons for Web Connection


.

Introduction:  The purpose of this article is to provide the computer user with a methodology for easily enabling and disabling the connection to the internet.

.

Problem:  Connection to the internet (whether via WiFi or Ethernet cable) is always enabled by Windows even though the active connection is not required by the computer user.  Further, manually enabling and disabling the connection requires the computer user to tunnel through a variety of screens, which is time consuming.

.

Solution:  Desktop shortcuts/buttons can be created and programmed to enable  or disable the Network Adapter with a mouse click – thus controlling the adapter / internet connection as easily as turning on/off a light bulb.

.

Step 1:   Ascertain the “index” number for your Network Adapter that is uniquely assigned by your windows and used to connect to the internet:

  • Open a command window by running: cmd.exe
  • Run the following command line at the prompt>:

wmic nic get name, index

  • Find the Network Adapter Device used to connect to the internet
  • Jot down the line number the device is listed on as this is the “index” number needed for the next step.

.

Step 2: Right click on the Desktop and select “New” then “Shortcut”

.

Step 3: In the field, either type in or copy the line below into it:

wmic path win32_networkadapter where index=? call disable

.

Step 4:  Next replace the question mark (?) in the line above with the index number ascertained from Step 1.  (FYI – be sure there is a space before and after the “call” routine/code)

.

Step 5: Click “Next” a couple of times until the shortcut is established on the desktop.

.

Step 6: Now test this short cut by Clicking or Double Clicking it.  The command line inside it should disable the Network Adapter and you should see its icon near the clock indicate a deactivated connection.

.

If it DID NOT Disable the connection, then it is likely that the index number in the command line is incorrect.   Therefore, review or re-run Step 1 and select a different index number to input into the command line inside the shortcut.  (Remember, to modify the shortcut just Right Click, then select Properties.). Next Re-test the shortcut.

If you are having difficulty in figuring out the name of your Network Adapter/Device, you can find it also listed inside the Device Manager Control Panel.  It will be listed under the Network Adapters Section.  The Adapter Names listed in the Device Manager should be similar to that report generated with Step 1.

.

If it DID Disable the connection, then the next step is to create another shortcut that will “Enable” the connection.  To do this:

.

Step 7: Right Click on the Shortcut you just created and select “Copy”.

.

Step 8: Then Right Click on the Desktop and select “Paste’

.

Step 9: Next modify the command line inside the second shortcut so that it will Enable / Activate the connection:

  • Right Click on the shortcut, then select “Properties”
  • Alter the command line by replacing the word “disable”  with “enable”
  • Click “Next” a couple of times to establish the shortcut on the desktop
  • Next test the shortcut to ensure it enable the connection and the icon near the clock indicates “activated”.

.

If your shortcuts are now able to activate and deactivate your connections successfully, the next step is to customize the shortcuts so you know what they are.

.

Step 10: Right Click on the Shortcut then Select “Rename”.

.

Step 11: Rename accordingly. For example: Wifi On or Wifi Off.

.

Tip 1:  To further customize the shortcuts to help distinguish them better, like having a reddish icon for disable and a greenish icon for enable, you can change the shortcut image by:

  • Right Click on one of the Short Cuts,
  • Select Properties then
  • Click button called Change Icon
  • Then browse to this file that contains a cache of icons to choose from:

c:\windows\system32\pnidui.dll

More icons can be found in the same directory, ie, \windows\system32\, inside these other files:

explorer.exe
accessibilitycpl.dll
ddores.dll
gameux.dll
imageres.dll
moricons.dll
mmcndmgr.dll
mmres.dll
netcenter.dll
netshell.dll
networkexplorer.dll
pifmgr.dll
pnidui.dll
sensorcpl.dll
setupapi.dll
wmploc.dll
wpdshext.dll

.

Tip 2: By using the same methodology to create shortcuts that control 1 of your adapters, additional shortcuts can similarly be created to control other network adapters.  For example, a set can control the Wifi, while another set can control the Ethernet Cable/connection.

.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s