literature

Windows Network Shell WAP Priority Editor

Deviation Actions

DouJinFlip's avatar
By
Published:
152 Views

Literature Text

@echo OFF
title netsh WAP Priority Change Tool

echo =================================================================
echo Network Shell Wi-Fi Access Point Priority Editor                          
echo.
echo Edit script so that the Interface name matches target NIC.
echo Enter an known AP name below to begin.
echo =================================================================
echo.

:rerun
netsh wlan show profiles
echo.
echo =================================================================
echo Previous change:
echo     AP name  = %apname%
echo     priority = %newpri%
echo =================================================================
echo.
SET /p apname=Change priority for Which AP? (full name):

SET /p newpri=What priority? (positive integer -- 1 is top):

netsh wlan set profileorder name="%apname%" interface="Wi-Fi" priority=%newpri%

CLS
GOTO :rerun
This is a small but useful program I wrote through Windows Batch while in school in Fall 2016. It assists in changing the priority of connection for saved WiFi access points (SSID) in the case that the computer has multiple previously connected SSIDs to choose from (the default always goes for the most recent one added). This is useful if, say, you'd always rather connect to the local boba shop you're sitting in rather than the Starbucks across the street. This program uses native Windows "netsh" commands, but puts it into a more GUI-like format where you simply input the two variables to be changed (the SSID and its numerical priority). It also outputs the last attempted change to help figure out what just happened. As these are still otherwise pure netsh commands, SSIDs must not be misspelled (otherwise nothing happens), and there is no numbering to guide the reprioritization (I simply guess a number, find out where the target SSID ended up, and try again).

To run this program yourself, copy the above text into a new .txt file (such as Notepad), save it somewhere, and then change the ".txt" in the filename to ".bat". You may have to disable the "Hide extension for known file types" feature in Windows Explorer to do so. Remember to change the Interface name in the source code if it does not go by the default name "Wi-Fi". You can later make edits by right-clicking on the file and selecting Edit.
Comments0
Join the community to add your comment. Already a deviant? Log In