上次写了一个查看wifi的bat文件(https://www.cnblogs.com/feiquan/p/9823402.html),发现有个问题就没法保存到记事本,而且还要处理不同的系统语言,这次重新更新了一下文件。

获取方式:

  1.可直接拷贝代码到记事本后改后缀为bat

  2.百度网盘:      

    链接:https://pan.baidu.com/s/11syCrBvehtpPo7R9cfpk0g

    提取码:8qhn

主要有3个文件:

Password是最后密码的存放文件夹,其中的文件是以时间命名的,保证不会覆盖

WiFiPassswordSave.bat 是功能选择界面(直接双击它运行)

seeWiFi.bat :是第一个功能(直接查看wifi密码)

saveWiFi.bat:是第二个功能(保存密码到当前目录下的Password\wifiPassword.txt),如果是直接双击此文件或者不带参数,在输出完成后会自动打开密码所在的文件夹,如果在命令行中输入( saveWiFi.bat  h)加入参数 h,将会定位到密码所在的文件夹,并列出文件目录

提示:这三个bat文件必须要放在同一个文件夹下,如果使用cmd命令可单独调用seeWiFi.bat 和saveWiFi.bat

更新情况:

  1. REM echo UpdataDate:// :
  2. REM echo Version:1.1.1v
  3. REM 修复wifi名为空时,打印不完全
  4. rem 重命名保存的文件名 主机名+用户名+wifiPassword+当前时间
  5. rem 更改临时文件的位置

上代码(可直接拷贝代码到记事本后改后缀为bat):

WiFiPassswordSave.bat

  1. @echo off
  2. if not "%OS%"=="Windows_NT" EXIT
  3. REM if not "%0"=="WiFiPassswordSave.bat" exit
  4. chcp >nul
  5. if "%1"=="back" (
  6. echo ====================================
  7. goto fun
  8. )
  9. Title WiFiPasswordSave
  10. echo WiFiPasswordSave
  11. color
  12. echo ====================================
  13. echo Author:feiquan
  14. echo Create:// :
  15. echo UpdataDate:// :
  16. echo Version:1.1.1v
  17. echo Function:See and Save your computer connnect all WiFi password
  18. REM echo Function:See and Save your computer connnect all WiFi password
  19. REM 修复wifi名为空时,打印不完全
  20. rem 重命名保存的文件名
  21. rem 更改临时文件的位置
  22. REM echo =====================================
  23.  
  24. rem 删除不需要的文件
  25. if exist "%temp%\userfiles.txt" ( del %temp%\userfiles.txt )
  26. if exist "%temp%\userfiles2.txt" ( del %temp%\userfiles2.txt )
  27. if exist "%temp%\password.txt" (del %temp%\password.txt)
  28. if exist "%temp%\wifiPassword2.txt" ( del %temp%\wifiPassword2.txt )
  29.  
  30. :fun
  31. rem 选择功能
  32. echo Select function:
  33. echo .See WiFi password
  34. echo .Save all Wifi Password to wifipassword.txt
  35. echo .exit
  36. echo =====================================
  37.  
  38. set num=
  39. set /p num=请输入你想执行那个功能^(默认:^)^:
  40.  
  41. if %num%== (
  42. rem 功能一:直接查看wifi密码
  43. call seeWiFi.bat
  44.  
  45. ) else if %num%== (
  46. rem 功能二:保存密码到当前目录下的Password\wifi%temp%\password.txt
  47. call saveWiFi.bat
  48.  
  49. ) else (
  50. rem 删除不需要的文件
  51. if exist "%temp%\userfiles.txt" ( del %temp%\userfiles.txt )
  52. if exist "%temp%\userfiles2.txt" ( del %temp%\userfiles2.txt )
  53. if exist "%temp%\password.txt" (del %temp%\password.txt)
  54. if exist "%temp%\wifiPassword2.txt" ( del %temp%\wifiPassword2.txt )
  55.  
  56. exit
  57. )
  58.  
  59. pause
  60. exit

seeWiFi.bat

  1. @echo off
  2. if not "%OS%"=="Windows_NT" EXIT
  3. if not "%0"=="seeWiFi.bat" exit
  4. chcp >nul
  5. title seeWiFi
  6. REM echo WiFiPasswordSave
  7. REM echo ====================================
  8. REM echo Author:feiquan
  9. REM echo Create:// :
  10. REM echo UpdataDate:// :
  11. REM echo Version:1.1.1v
  12. REM echo Function:See and Save your computer connnect all WiFi password
  13. REM 修复wifi名为空时,打印不完全
  14. rem 重命名保存的文件名
  15. rem 更改临时文件的位置
  16. REM echo =====================================
  17.  
  18. rem 获取用户配置文件,实时刷新
  19. netsh wlan show profiles |find "All User Profile" >%temp%\userfiles.txt
  20. rem 提取SSID name
  21. powershell -Command "(gc %temp%\userfiles.txt) -replace ' All User Profile : ', ''" >%temp%\userfiles2.txt
  22.  
  23. rem 删除不需要的文件
  24. if exist "%temp%\userfiles.txt" ( del %temp%\userfiles.txt )
  25.  
  26. rem 功能一:直接查看wifi密码
  27. rem 列出wifi
  28. echo Your computer connnect all WiFi name:
  29. for /f "tokens=*" %%f in (%temp%\userfiles2.txt) do echo %%f
  30. rem 选择wifi,给name赋值
  31. echo =====================================
  32. :loop
  33. set /p name=Please input your WiFi name(SSID):
  34. ( netsh wlan show profiles name="%name%" key=clear |find "SSID name" ) ||echo SSID name : "%name%"
  35. ( netsh wlan show profiles name="%name%" key=clear |find "Key Content" ) ||echo Key Content : NO exist
  36. echo =====================================
  37. :continue
  38. set con=y
  39. set /p con=Continue to look up other WiFi password^(默认:y^/n^/q^)^:
  40. if "%con%"=="y" (
  41. goto loop
  42. ) else if "%con%"=="n" (
  43. call WiFiPassswordSave.bat back
  44.  
  45. ) else if "%con%"=="q" (
  46. if exist "%temp%\userfiles.txt" ( del %temp%\userfiles.txt )
  47. if exist "%temp%\userfiles2.txt" ( del %temp%\userfiles2.txt )
  48. exit
  49. ) else (
  50. goto continue
  51. )
  52. rem 功能一:end

saveWiFi.bat

  1. @echo off
  2. if not "%OS%"=="Windows_NT" EXIT
  3. if not "%0"=="saveWiFi.bat" exit
  4. @echo off
  5. chcp >nul
  6. title saveWiFi
  7. REM echo WiFiPasswordSave
  8. REM echo ====================================
  9. REM echo Author:feiquan
  10. REM echo Create:// :
  11. REM echo UpdataDate:// :
  12. REM echo Version:1.1.1v
  13. REM echo Function:See and Save your computer connnect all WiFi password
  14. REM 修复wifi名为空时,打印不完全
  15. rem 重命名保存的文件名
  16. rem 更改临时文件的位置
  17. REM echo =====================================
  18.  
  19. echo Starting working ....
  20.  
  21. rem 删除不需要的文件
  22. if "%1"=="h" (
  23. if exist "%temp%\userfiles.txt" ( del %temp%\userfiles.txt )
  24. if exist "%temp%\userfiles2.txt" ( del %temp%\userfiles2.txt )
  25. if exist "%temp%\password.txt" (del %temp%\password.txt)
  26. if exist "%temp%\wifiPassword2.txt" ( del %temp%\wifiPassword2.txt )
  27. )
  28.  
  29. rem 获取用户配置文件,实时刷新
  30. netsh wlan show profiles |find "All User Profile" >%temp%\userfiles.txt
  31. rem 提取SSID name
  32. powershell -Command "(gc %temp%\userfiles.txt) -replace ' All User Profile : ', ''" >%temp%\userfiles2.txt
  33.  
  34. rem 删除不需要的文件
  35. if exist "%temp%\userfiles.txt" ( del %temp%\userfiles.txt )
  36.  
  37. rem 功能二:保存密码到%temp%\password.txt
  38.  
  39. rem 遍历SSID name
  40. for /F "tokens=*" %%i in (%temp%\userfiles2.txt) do (
  41. echo ==========================================================>>%temp%\password.txt
  42. ((netsh wlan show profiles name="%%i" key=clear |find "SSID name")||echo SSID name : "%%i" )>>%temp%\password.txt
  43. ((netsh wlan show profiles name="%%i" key=clear |find "Key Content")||echo Key Content : NO exist )>>%temp%\password.txt
  44. )
  45.  
  46. rem 替换关键字
  47. powershell -Command "(gc %temp%\password.txt) -replace 'SSID name', 'Wifi name'" >%temp%\wifiPassword2.txt
  48. set cName=%computername%
  49. set uName=%username%
  50. powershell -Command "(gc %temp%\wifiPassword2.txt) -replace 'Key Content','Password '>%cName%_%uName%_wifiPassword"$(Get-Date -Format 'yyyyMd Hms')".txt"
  51.  
  52. rem 删除不需要的文件
  53. if exist "%temp%\userfiles.txt" ( del %temp%\userfiles.txt )
  54. if exist "%temp%\userfiles2.txt" ( del %temp%\userfiles2.txt )
  55. if exist "%temp%\password.txt" (del %temp%\password.txt)
  56. if exist "%temp%\wifiPassword2.txt" ( del %temp%\wifiPassword2.txt )
  57.  
  58. rem 移动文件
  59. if not exist Password mkdir Password
  60. move %cName%_%uName%_wifiPassword* .\Password
  61. cd Password
  62.  
  63. if not "%1"=="h" (
  64. start .\
  65. exit
  66. )
  67.  
  68. dir
  69. rem 功能二:end

使用cmd查看电脑连接过的wifi密码(二)的更多相关文章

  1. 使用cmd查看电脑连接过的wifi密码并将密码发送至指定邮箱(三)

    之前,我写了使用cmd查看电脑连接过的wifi密码(二)和使用cmd查看电脑连接过的wifi密码(一)但其中的功能不完善,在本次的更新中新增了更多的功能,其实2018/10/24 就更新完成了,一直拖 ...

  2. 使用cmd查看电脑连接过的wifi密码(一)

    有时总会忘记之前的wifi密码,这时候就需要查看wifi密码: 这个我就写了一个bat文件,方便下次使用,这里我添加了中文和英文的判断,主要是语言不同输出的信息不用,不说了直接上代码: @echo o ...

  3. 查看window系统电脑连接过的wifi密码

    电脑连接过的wifi都会有痕迹,包括SSID号和密码等信息,借此可以回查wifi密码信息. 步骤: 1.开始----运行----输入cmd 2.在dos窗口输入以下代码: “for /f " ...

  4. windows10查看电脑已经保存的wifi密码

    1,打开windows的命令窗口,输入    netsh wlan show profiles,如下图,这个命令仅仅只是查看一下电脑保存的所有的wifi名字 2,需要查看密码的话,则需要输入这个命令, ...

  5. 怎样查看电脑登录过的wifi密码?

    https://jingyan.baidu.com/album/fcb5aff770f7e6edaa4a71d9.html?picindex=7

  6. 查找已连接过的wifi密码

    无意之间看到能破解已连接过的wifi密码的诀窍,赶紧存储下来. 1. 首先打开终端 2. 在没有网路的情况下输入: netsh wlan show profiles 结果如下(自己的): 这些‘用户配 ...

  7. [转帖]一键获取 所有连接过的wifi 密码

    cmd 一键获取 所有连接过的wifi 密码 转帖来源: http://www.cnblogs.com/hookjoy/p/5537623.html for /f "skip=9 token ...

  8. 电脑cmd命令快速查看连接过的WIFI密码信息

    只是突然发现,好奇心作怪,试了一下,妈妈再也不用担心我忘记家里的wifi密码了 1.直接打开"运行"(win键+R) 2.输入CMD 确定 3.输入下面cmd命令.鼠标粘贴 for ...

  9. win10以前连接过的wifi密码怎么查看

    右键点击开始,在菜单中选择打开命令提示符,以管理员的权限打开.  然后输入命令netsh wlan show profile显示以前此电脑连接过的所有WIFI记录配置信息.    确定要查看的WIFI ...

随机推荐

  1. [Swift]LeetCode519. 随机翻转矩阵 | Random Flip Matrix

    You are given the number of rows n_rows and number of columns n_cols of a 2D binary matrix where all ...

  2. [Swift]LeetCode657. 机器人能否返回原点 | Robot Return to Origin

    There is a robot starting at position (0, 0), the origin, on a 2D plane. Given a sequence of its mov ...

  3. [Swift]LeetCode851. 喧闹和富有 | Loud and Rich

    In a group of N people (labelled 0, 1, 2, ..., N-1), each person has different amounts of money, and ...

  4. [Swift]LeetCode976. 三角形的最大周长 | Largest Perimeter Triangle

    Given an array A of positive lengths, return the largest perimeter of a triangle with non-zero area, ...

  5. 为什么公司宁愿 25K 重新招人,也不给你加到 20K?原因太现实……

    年底了,还有几天就要过年了,年后必定又是一波跳槽季,我们为什么要跳槽,为什么公司不能满足我们加薪的需求? 说到这个话题,想必从事码农的各位都清楚的一个道理:工资都是跳出来的,其他行业我不太清楚,但在 ...

  6. 面试题:反转字符串(leetcode344)

    编写一个函数,其作用是将输入的字符串反转过来.输入字符串以字符数组 char[] 的形式给出. 不要给另外的数组分配额外的空间,你必须原地修改输入数组.使用 O(1) 的额外空间解决这一问题. 你可以 ...

  7. ThinkPHP 数据库操作(四) : 聚合查询、时间查询、高级查询

    聚合查询 在应用中我们经常会用到一些统计数据,例如当前所有(或者满足某些条件)的用户数.所有用户的最大积分.用户的平均成绩等等,ThinkPHP为这些统计操作提供了一系列的内置方法,包括: 用法示例: ...

  8. BBS论坛(二十四)

    24.1.编辑板块 cms/js/banners.js $(function () { $('.edit-board-btn').click(function () { var self = $(th ...

  9. Mac版AppStore无法下载、升级错误处理

    在mac版本AppStore下载软件的时候,有时会出现"This item is temporarily unavailable, Try again later"错误提示,当然等 ...

  10. 带着萌新看springboot源码13(手写一个自己的starter)

    springboot的最强大的就是那些xxxAutoconfiguration,但是这些xxxAutoConfiguration又依赖那些starter,只有导入了这些场景启动器(starter),我 ...