-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetSSDandPWscript.bat
More file actions
48 lines (40 loc) · 1.22 KB
/
getSSDandPWscript.bat
File metadata and controls
48 lines (40 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
@echo off
:START
color 1F
cls
title View wireless SSID list
::Display list of SSIDs stored in this computer and prompt user to choose one
Netsh wlan show profiles
Echo If you wish to view the security key for one of the above SSIDs,
Set /p SSID=enter its name here:
echo.
::Detect whether the user's chosen SSID is in the list
Netsh wlan show profiles | find /i "%SSID%" > NUL
If errorlevel 1 (
::warn user that SSID is not in the list, then start over
color cf
echo.
echo Sorry, that SSID is not found.
pause
goto start
)
:VIEWKEY
::The below spacing is deliberately wide for readability of results when a security key is displayed
echo SSID : %SSID%
::Display key content if available
netsh wlan show profile name="%SSID%" key=clear | find "Key Content"
::Detect whether a key was found or not.
If errorlevel 1 (
::Turn yellow and warn if a key is not found for this SSID
color 6f
echo The security key is not found for this SSID.
) ELSE (
::Turn green if a key is found for this SSID
color 2f)
echo.
::Give the user a chance to view another key
choice /c YN /m "Do you want to view another?"
If errorlevel 2 goto EXIT
If errorlevel 1 goto start
:EXIT
exit /b