Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2016
798
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.14 KB | None | 0 0
  1. @echo off
  2. :START
  3. color 1F
  4. cls
  5. title View wireless SSID list
  6. ::Display list of SSIDs stored in this computer
  7. Netsh wlan show profiles
  8. Echo If you wish to view the security key for one of the above SSIDs,
  9. Set /p SSID=enter its name here:
  10. echo.
  11. ::Detect whether the user's chosen SSID is in the list, and warn the user if it is not.
  12. Netsh wlan show profiles | find /i "%SSID%" > NUL
  13. If errorlevel 1 (
  14.     color cf
  15.     echo.
  16.     echo Sorry, that SSID is not found.
  17.     pause
  18.     goto start
  19.     )
  20.  
  21. :VIEWKEY
  22. ::The below spacing is deliberately wide for readability of results when a security key is displayed
  23. echo     SSID                   : %SSID%
  24. ::Detect whether a security key is found for this SSID or not
  25. netsh wlan show profile name="%SSID%" key=clear | find "Key Content"
  26. If errorlevel 1 (
  27.     ::Turn yellow and warn if a key is not found for this SSID
  28.     color 6f
  29.     echo The security key is not found for this SSID.
  30.     ) ELSE (
  31.     ::Turn green if a key is found for this SSID
  32.     color 2f)
  33. echo.
  34. ::Give the user a chance to view another key
  35. choice /c YN /m "Do you want to view another?"
  36. If errorlevel 2 goto EXIT
  37. If errorlevel 1 goto start
  38.  
  39. :EXIT
  40. exit /b
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement