Monday, 11 April 2016 11:58

Network switch port blinker - Identify switch ports with Windows batch file

Written by 
Rate this item
(3 votes)

Windows Network Switch Port Blinker

Windows laptop running a batch file to identify remote network switch ports

Using a Windows laptop, and a simple batch file written with notepad, I was able to map out many network drops.

I needed to map out numerous network drops at my work the other day, and I did not have my tone and probe set, or any other specific network tools that can assist me with the task at hand.  I did have a Windows 7 laptop, so I came up with this method to help me find each network drop that I needed to map to a specific network switch located in a closet.

The idea is to connect my laptop to the network jack at the wall, run the batch file, and walk over to the network closet and find the blinking LED light on the switch.  It ended up easier and faster than I expected.


Create and run the Batch File

The batch file continuously enables and disables the local Lan port on your laptop or PC every few seconds causing the link light on the network switch to blink.

On your laptop, open up notepad and copy & paste the following.  On 2 lines below, change the interface name= to match your interface name on your laptop, in between the quotes ie: "Local Area Connection 2" or "Local Area Connection" etc).  You can find your interface name by looking in Network Connections in the control panel.

timeout 5
netsh interface set interface name="Local Area Connection" admin=disabled
timeout 5
netsh interface set interface name="Local Area Connection" admin=enabled
goto :while1


Save the file with the extension .bat (instead of .txt) (ie: portblink.bat)

Connect the network cable to your local Lan port, and double click on the *.bat file you just created.  You should now see the LED blink consistently on the switch port that your laptop is connected to.

*Note: Be sure to re-enable your local Lan interface after running the script, you can do this by running (changing the interface name as needed):

netsh interface set interface name="Local Area Connection" admin=enabled

in the command prompt, or by going to Control Panel > Network and Internet > Network Connections and right clicking on your interface and selecting enable.



Here's a short clip I made watching a network switch LED blink from my batch script.  Watch the LEDs on port 14 blink on and off.



This is a very simple and quick way to identify network switch ports using your Windows laptop.  I tested this using a Windows 7 laptop.  A tone and probe set can help locate and map network drops, and this will not replace that, but if you have an idea of what switch the drop terminates at, this will also do the job.  I did notice on one of the switches that I tested on, the port led would turn off when the batch file disabled my Lan interface, but it would light back up, a second or two later (before the batch file enabled my Lan port), this is still ok, as the on/off times on the network port LED still blinked in a consistent manner.




Read 18724 times Last modified on Tuesday, 12 April 2016 12:10
Algis Salys

Creator and owner of  Linux enthusiast, electronics tinkerer, and likes to spend time in the workshop building and creating new projects.