Here is another quick tool for this weekend. This tool simply grabs the output from NETSH WLAN SHOW INTERFACE and displays the results in the Windows interface (because you can’t quickly see all this in the Windows GUI). You can change the refresh interval in ms.
If no wireless connection is active, you will see a screen like the following:
When a connection is active, you will see the following:
If you want to have the percentage signal strength converted to dBm, you can use the following formula:
NOTE: Tool has been updated to resolve problems on some systems. (Feb. 13, 2017)
OK. I have a problem with NETSH. It shows signal levels in percentages based on a known algorithm, but gives no option to show dBm levels. Hence, WiFiScan.exe. This little tool will pull the NETSH information in, convert signal strength to show dBm as well (for strengths weaker than -50 and stronger than -100) and show them parenthetically after the percentage info. The command is the same as:
NETSH WLAN SHOW NETWORKS MODE=BSSID
It goes against the default WLAN interface and has no parameters. I may modify it to allow for interface specification, but it serves my purpose for now. By the way, the conversion to dBm follows this logic:
The wifiscan.exe tool should be run while not connected to a WLAN. It will sort of work if you’re connected, but give you an error related to an array. I may fix that when energy returns. Here’s the tool, feel free to download and use at your own risk [smile]:
I mentioned this script an a class recently. I threw it together sometime back. It’s not elegant, but it does what I wanted. It’s actually pretty beautiful when you consider that it was written late one night 🙂
It would need some tweaking to work as a command line script.
Just place it where you want it and then right-click and choose Run with PowerShell to get a listing of discovered networks sorted by channel.
By the way, I was studying two PowerShell concepts at the time: file access and pulling in NETSH information. I had used a method without files, but this was the last one I played with. If you want one without temp files, let me know. I can throw that together and post it too. This is mostly a learning tool for you.
Have fun and let me know if you make some great changes.
Here is a simple batch file that will get information from NETSH without the lengthy commands. No error checking. A little help. But it’s the one I use. I added a menu for those who want interactive use. Copy and past it into a file with a .bat extension and you’re good to go. I name mine wifi.bat. Someone asked for it so I thought I’d share it with the world.
Just run wifi.bat with no params to get help. Run “wifi.bat menu” to see the interactive menu I built just for you!
Have fun, tweak and change all you like.
if [%1]== GOTO HELP
if /I %1==interfaces GOTO SHOWALL
if /I %1==networks GOTO NETWORKS
if /I %1==drivers GOTO DRIVERS
if /I %1==settings GOTO SETTINGS
if /I %1==menu GOTO MENU
netsh wlan show interfaces %1
netsh wlan show networks interface=%2
netsh wlan show drivers interface=%2
netsh wlan show settings
netsh wlan show interfaces
ECHO Choose from the following options:
ECHO I = Show all wireless interfaces
ECHO S = Show general wireless settings
ECHO N = Show wireless networks on default interface
ECHO D = Show drivers on default interface
choice /C ISND /M "Make your selection: "
if %errorlevel%==1 NETSH WLAN SHOW INTERFACES
if %errorlevel%==2 NETSH WLAN SHOW SETTINGS
if %errorlevel%==3 NETSH WLAN SHOW NETWORKS
if %errorlevel%==4 NETSH WLAN SHOW DRIVERS
ECHO NETSH Speedy Interface Script
ECHO This command provides information about Wi-Fi
ECHO interfaces. The proper use is:
ECHO wifi interface_name
ECHO interface_name should be in quotation marks if
ECHO the name has one or more spaces. For example:
ECHO wifi "Wi-Fi 1"
ECHO When interface names are not known, use the
ECHO modifier interfaces without an interface name.
ECHO Other modifier commands may be used to show other
ECHO information. Such commands should precede the
ECHO interface_name parameter. Only one modifier'
ECHO command may be used at a time.
ECHO Possible modifier commands include:
ECHO networks - show networks
ECHO drivers - show drivers
ECHO settings - show general settings
ECHO menu - use an interactive menu
ECHO For example:
ECHO wifi networks "Wi-Fi 1"
ECHO would show the wireless networks seen by that
ECHO Created by Tom Carpenter, 2016
I have been working with various Linux distributions much more these days than in the past. Spending all that time in the shell has flooded the mind with memories of days gone by. When we used to have to know our systems well to properly configure the simple task of booting (config.sys and autoexec.bat), we had to master many technical skills. I am amazed, nearly every day, at how often those old skill still prove valuable to me.
Remember screens like this?
If not, you didn’t work with DOS. If so, you did. If not, don’t distress, you can learn the skills you need to get by in the Windows Command Prompt, PowerShell or the shell in a Linux distribution.
In this post, I’m going to focus on three skills we had to master in the DOS days that are still valuable today. They were:
System Diagnostics with Commands
At the DOS prompt (and still in the Command Prompt or PowerShell in Windows and the shell in Linux) help was always just a simple switch away. For nearly every command or program, you could simply add a /? to the command to find out exactly what the command could do. Those who learned (and still learn) commands this way are always more powerful users or administrators than those who simply learn specific command parameters for specific tasks from books, blogs and articles.
The reason for this reality is simple: when you use the help to see all the command can do, you often learn of uses that others have not demonstrated or used themselves.
Consider the mem command shown earlier from DOS. If you simply typed mem and pressed ENTER, you saw a screen like the following.
Now look at all you learned about the mem command if you used the /? parameter.
I can already hear someone saying, “Wait, Tom. The mem command is not in the Windows Command Prompt anymore. How does this help?” That’s a great question. The answer is that you can find other commands, related to memory, that you can use and use with power when you learn to get help. Consider the tasklist command in Windows.
The following screen shows the output of a basic tasklist command with no parameters:
It is showing every process, regardless of the memory consumed by it. Now, look at the help for the tasklist command using the /? parameter.
Notice that you can do several things to refine the list, particularly in relation to memory usage.
Armed with this information, I can now use the /FI filter parameter to see only tasks consuming more than 15,000 kilobytes of memory with the tasklist /FI “MEMUSAGE gt 15000” command.
As you can see, getting help is key to learning Command Prompt or shell commands. In Linux, you typically use the —help parameter for this. In PowerShell, use the Get-Help cmdlet to accomplish this.
System Diagnostics with Commands
The old DOS prompt gave us several tools for performing system diagnostics. In addition to the mem command, you had commands like checkdsk, ver (both still in the Command Prompt), and undelete (sadly, no longer with us). The Command Prompt is actually far more powerful today in Windows than it ever was in DOS. Dozens of additional commands are available for diagnostics. In addition to tasklist, important commands include:
sc – service management
ipconfig – IP configuration viewing and management
netsh – a plethora of networking functions
systeminfo – viewing information about hardware and software
ftype – working with file associations
This is a very brief starter list. Type help at the Command Prompt (just like in DOS by the way) to see a list of common commands as shown in the following image. Remember to use the /? parameter with them to learn all the details of how they work.
Finally, you can automate the Command Prompt using batch files and PowerShell or the Linux shell using scripts (PowerShell scripts and bash scripts respectively). The batch files work almost entirely the same in the Windows Command Prompt today as they did in DOS 25+ years ago when I used them. Of course, some of the old commands are gone, but the logic and concepts are still the same.
The point of this post is simple. Never discount old knowledge. It continues to benefit you today. In fact, I can say plainly that I passed a certification exam a couple of years ago almost entirely because I knew DOS all those years ago. And, yes, I still have my old DOS books including great books on batch files. Here’s a picture of just one.
And, yes as well, the Disk is still included after all these years 🙂