Advertisement
Guest User

Wlan Profile Viewer

a guest
Sep 21st, 2015
450
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.62 KB | None | 0 0
  1. @ECHO OFF
  2. setlocal enabledelayedexpansion
  3.  
  4. REM ===============[ Main Menu ]===============
  5. :Menu
  6. CLS
  7. Color 0A
  8. Echo.
  9. Echo.
  10. Echo Windows Wifi Profile Viewer
  11. Echo ==================================
  12. Echo.
  13. Echo Select Operation:
  14. Echo.
  15. Echo 1^> View Wifi profiles.
  16. Echo 2^> Export All Profiles to separate files.
  17. Echo 3^> Exit
  18. Echo.
  19. SET "cho="
  20. SET /P "cho= Select: "
  21. IF /I "%cho%" == "1" Goto :VProfile
  22. IF /I "%cho%" == "2" Goto :ExportPro
  23. IF /I "%cho%" == "3" Goto :EOF
  24. CLS
  25. Color 0C
  26. Echo.&Echo.&Echo.&Echo Error! , No Such Option.
  27. Ping Localhost -n 4 >NUL
  28. GOTO :Menu
  29.  
  30. REM ===============[ /Main Menu ]===============
  31.  
  32. REM ===============[ View Profiles ]===============
  33.  
  34. :VProfile
  35. CLS
  36. Color 0A
  37. Set i=1
  38. for /f "skip=9 tokens=1-4* delims= " %%A in ('netsh wlan show profile') Do (
  39. SET "Line=%%A %%B %%C %%D %%E"
  40. SET array[!i!]=%%E
  41. SET /a i+=1
  42. )
  43. set n=%i%
  44.  
  45. SET /a UBound=i-1
  46. Echo ==================================
  47. Echo.
  48. Echo Select WiFi Profile:
  49. Echo.
  50. Echo ==================================
  51. for /l %%i in (1,1,%UBound%) Do (
  52. echo %%i^>. !array[%%i]!
  53. )
  54. Echo ==================================
  55. Echo.
  56. echo m^>. Return to main menu
  57. echo x^>. Exit
  58. Echo.
  59. Echo ==================================
  60.  
  61. SET /P "i= Select: "
  62. for /L %%i in (%i%,1,%i%) Do (
  63. echo !array[%%i]! > %temp%\wlan_name
  64. netsh wlan show profile name="!array[%%i]!" key="clear" |find "Key Content" >> %temp%\wlan_pass
  65. )
  66. IF /I "%i%" == "m" Goto :Menu
  67. IF /I "%i%" == "x" Goto :EOF
  68.  
  69. for /F %%h in ('type "%temp%\wlan_name"') do set wlan=%%h
  70. for /F "tokens=3 delims=: " %%g in ('type "%temp%\wlan_pass"') do set wpass=%%g
  71.  
  72.  
  73. cls
  74.  
  75. echo ===================================
  76. echo Selected Network: %wlan%
  77. echo Password : %wpass%
  78. echo ===================================
  79. echo.
  80. echo.
  81. echo What would you like to do next?
  82. echo.
  83. Echo 1^> Save to File.
  84. Echo 2^> Return to main menu.
  85. Echo 3^> Exit.
  86. SET "cho="
  87. SET /P "cho= Select: "
  88. IF /I "%cho%" == "1" Goto :SProfile
  89. IF /I "%cho%" == "2" Goto :Menu
  90. IF /I "%cho%" == "3" Goto :EOF
  91. CLS
  92. Color 0C
  93. Echo.&Echo.&Echo.&Echo Error! , No Such Option.
  94. Ping Localhost -n 4 >NUL
  95. Goto :VProfile
  96.  
  97.  
  98.  
  99.  
  100.  
  101. REM ===============[ Save to Text File ]===============
  102. :SProfile
  103. CLS
  104. Color 0A
  105. set mydir="C:\Wlan"
  106. IF not exist %mydir% (mkdir "%mydir%")
  107. Echo ===================================
  108. Echo Text file will be saved to C:\Wlan\%wlan%-Wlan.txt by default
  109. Echo ===================================
  110. echo =================================== > C:\Wlan\%wlan%-Wlan.txt
  111. echo Selected Network: %wlan% >> C:\Wlan\%wlan%-Wlan.txt
  112. echo Password : %wpass% >> C:\Wlan\%wlan%-Wlan.txt
  113. echo =================================== >> C:\Wlan\%wlan%-Wlan.txt
  114. Echo Details have been saved.
  115. Echo ===================================
  116. Goto :Menu
  117.  
  118. REM ===============[ Export AlL Profiles ]===============
  119. :ExportPro
  120. set mydir="C:\Wlan"
  121. IF not exist %mydir% (mkdir "%mydir%")
  122. cd C:\Wlan
  123. netsh wlan export profile key=clear >NUL
  124. ren *.xml *.txt
  125. Goto :Message
  126.  
  127. :Message
  128. CLS
  129. Color 0A
  130. Echo Exporting Profiles.
  131. Echo [== ]
  132. Ping Localhost -n 2 >NUL
  133. CLS
  134. Echo Exporting Profiles..
  135. Echo [==== ]
  136. Ping Localhost -n 2 >NUL
  137. CLS
  138. Echo Exporting Profiles...
  139. Echo [====== ]
  140. Ping Localhost -n 2 >NUL
  141. CLS
  142. Echo Exporting Profiles.
  143. Echo [======== ]
  144. Ping Localhost -n 2 >NUL
  145. CLS
  146. Echo Exporting Profiles..
  147. Echo [==========]
  148. Ping Localhost -n 4 >NUL
  149. CLS
  150. Echo ===================================
  151. Echo All profiles Exported Sucessfully
  152. Echo Returning to main menu
  153. Echo ===================================
  154. Ping Localhost -n 4 >NUL
  155. Goto :Menu
  156. Pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement