Skip to content

批处理脚本示例

收集各种 Bash 常用操作的仓库,比如分割字符串、倒转数组等等:https://github.com/dylanaraps/pure-bash-bible

一个只能在命令行访问的文档查询网站,使用方法就是命令行执行 curl cheat.sh:https://github.com/chubin/cheat.sh

脚本之家源码下载参考:https://www.jb51.net/bat/

常见的 CMD 命令

cmd 常用命令

  1. appwiz.cpl:程序和功能
  2. calc:启动计算器
  3. certmgr.msc:证书管理实用程序
  4. charmap:启动字符映射表
  5. chkdsk.exe:Chkdsk 磁盘检查(管理员身份运行命令提示符)
  6. cleanmgr: 打开磁盘清理工具
  7. cliconfg:SQL SERVER 客户端网络实用工具
  8. cmstp:连接管理器配置文件安装程序
  9. cmd.exe:CMD 命令提示符
  10. 自动关机命令:

Shutdown -s -t 600:表示 600 秒后自动关机

shutdown -a :可取消定时关机

Shutdown -r -t 600:表示 600 秒后自动重启

rundll32 user32.dll,LockWorkStation:表示锁定计算机

  1. colorcpl:颜色管理,配置显示器和打印机等中的色彩
  2. CompMgmtLauncher:计算机管理
  3. compmgmt.msc:计算机管理
  4. credwiz:备份或还原储存的用户名和密码
  5. comexp.msc:打开系统组件服务
  6. control:控制面版
  7. dcomcnfg:打开系统组件服务
  8. Dccw:显示颜色校准
  9. devmgmt.msc:设备管理器
  10. desk.cpl:屏幕分辨率
  11. dfrgui:优化驱动器 Windows 7→dfrg.msc:磁盘碎片整理程序
  12. dialer:电话拨号程序
  13. diskmgmt.msc:磁盘管理
  14. dvdplay:DVD 播放器
  15. dxdiag:检查 DirectX 信息
  16. eudcedit:造字程序
  17. eventvwr:事件查看器
  18. explorer:打开资源管理器
  19. Firewall.cpl:Windows 防火墙
  20. FXSCOVER:传真封面编辑器
  21. fsmgmt.msc:共享文件夹管理器
  22. gpedit.msc:组策略
  23. hdwwiz.cpl:设备管理器
  24. inetcpl.cpl:Internet 属性
  25. intl.cpl:区域
  26. iexpress:木马捆绑工具,系统自带
  27. joy.cpl:游戏控制器
  28. logoff:注销命令
  29. lusrmgr.msc:本地用户和组
  30. lpksetup:语言包安装/删除向导,安装向导会提示下载语言包
  31. lusrmgr.msc:本机用户和组
  32. main.cpl:鼠标属性
  33. mmsys.cpl:声音
  34. magnify:放大镜实用程序
  35. mem.exe:显示内存使用情况(如果直接运行无效,可以先管理员身份运行命令提示符,在命令提示符里输入 mem.exe>d:a.txt 即可打开 d 盘查看 a.txt,里面的就是内存使用情况了。当然什么盘什么文件名可自己决定。)
  36. MdSched:Windows 内存诊断程序
  37. mmc:打开控制台
  38. mobsync:同步命令
  39. mplayer2:简易 widnows media player
  40. Msconfig.exe:系统配置实用程序
  41. msdt:微软支持诊断工具
  42. msinfo32:系统信息
  43. mspaint:画图
  44. Msra:Windows 远程协助
  45. mstsc:远程桌面连接
  46. NAPCLCFG.MSC:客户端配置
  47. ncpa.cpl:网络连接
  48. narrator:屏幕"讲述人"
  49. Netplwiz:高级用户帐户控制面板,设置登陆安全相关的选项
  50. netstat : an(TC)命令检查接口
  51. notepad:打开记事本
  52. Nslookup:IP 地址侦测器
  53. odbcad32:ODBC 数据源管理器
  54. OptionalFeatures:打开"打开或关闭 Windows 功能"对话框
  55. osk:打开屏幕键盘
  56. perfmon.msc:计算机性能监测器
  57. perfmon:计算机性能监测器
  58. PowerShell:提供强大远程处理能力
  59. printmanagement.msc:打印管理
  60. powercfg.cpl:电源选项
  61. psr:问题步骤记录器
  62. Rasphone:网络连接
  63. Recdisc:创建系统修复光盘
  64. Resmon:资源监视器
  65. Rstrui:系统还原
  66. regedit.exe:注册表
  67. regedt32:注册表编辑器
  68. rsop.msc:组策略结果集
  69. sdclt:备份状态与配置,就是查看系统是否已备份
  70. secpol.msc:本地安全策略
  71. services.msc:本地服务设置
  72. sfc /scannow:扫描错误并复原/windows 文件保护
  73. sfc.exe:系统文件检查器
  74. shrpubw:创建共享文件夹
  75. sigverif:文件签名验证程序
  76. slui:Windows 激活,查看系统激活信息
  77. slmgr.vbs -dlv :显示详细的许可证信息

slmgr.vbs -dli :显示许可证信息

slmgr.vbs -xpr :当前许可证截止日期

slmgr.vbs -dti :显示安装 ID 以进行脱机激

slmgr.vbs -ipk :(Product Key)安装产品密钥

slmgr.vbs -ato :激活 Windows

slmgr.vbs -cpky :从注册表中清除产品密钥(防止泄露引起的攻击)

slmgr.vbs -ilc :(License file)安装许可证

slmgr.vbs -upk :卸载产品密钥

slmgr.vbs -skms :(name[ort] )批量授权

  1. snippingtool:截图工具,支持无规则截图
  2. soundrecorder:录音机,没有录音时间的限制
  3. StikyNot:便笺
  4. sysdm.cpl:系统属性
  5. sysedit:系统配置编辑器
  6. syskey:系统加密,一旦加密就不能解开,保护系统的双重密码
  7. taskmgr:任务管理器(旧版)
  8. TM 任务管理器(新版)
  9. taskschd.msc:任务计划程序
  10. timedate.cpl:日期和时间
  11. UserAccountControlSettings 用户账户控制设置
  12. utilman:辅助工具管理器
  13. wf.msc:高级安全 Windows 防火墙
  14. WFS:Windows 传真和扫描
  15. wiaacmgr:扫描仪和照相机向导
  16. winver:关于 Windows
  17. wmimgmt.msc:打开 windows 管理体系结构(WMI)
  18. write:写字板
  19. wscui.cpl:操作中心
  20. wscript:windows 脚本宿主设置
  21. wuapp:Windows 更新

cmd 快捷命令

  1. gpedit.msc  组策略
  2. sndrec32  录音机
  3. Nslookup   IP 地址侦测器 ,是一个 监测网络中 DNS 服务器是否能正确实现域名解析的命令行工具。 它在 Windows NT/2000/XP 中均可使用 , 但在 Windows 98 中却没有集成这一个工具。
  4. explorer  打开资源管理器
  5. logoff  注销命令
  6. shutdown   60 秒倒计时关机命令
  7. lusrmgr.msc  本机用户和组
  8. services.msc  本地服务设置
  9. oobe/msoobe /a  检查 XP 是否激活
  10. notepad  打开记事本
  11. cleanmgr  垃圾整理
  12. net start messenger  开始信使服务
  13. compmgmt.msc  计算机管理
  14. net stop messenger  停止信使服务
  15. conf  启动 netmeeting
  16. dvdplay   DVD 播放器
  17. charmap  启动字符映射表
  18. diskmgmt.msc  磁盘管理实用程序
  19. calc  启动计算器
  20. dfrg.msc  磁盘碎片整理程序
  21. chkdsk.exe   Chkdsk 磁盘检查
  22. devmgmt.msc  设备管理器
  23. regsvr32 /u *.dll  停止 dll 文件运行
  24. drwtsn32  系统医生
  25. rononce -p   15 秒关机
  26. dxdiag  检查 DirectX 信息
  27. regedt32  注册表编辑器
  28. Msconfig.exe  系统配置实用程序
  29. rsop.msc  组策略结果集
  30. mem.exe  显示内存使用情况
  31. regedit.exe  注册表
  32. winchat   XP 自带局域网聊天
  33. progman  程序管理器
  34. winmsd  系统信息
  35. perfmon.msc  计算机性能监测程序
  36. winver  检查 Windows 版本
  37. sfc /scannow  扫描错误并复原
  38. taskmgr  任务管理器(2000/xp/2003
  39. winver  检查 Windows 版本
  40. wmimgmt.msc  打开 windows 管理体系结构(WMI)
  41. wupdmgr   windows 更新程序
  42. wscript   windows 脚本宿主设置
  43. write  写字板
  44. winmsd  系统信息
  45. wiaacmgr  扫描仪和照相机向导
  46. winchat   XP 自带局域网聊天
  47. mem.exe  显示内存使用情况
  48. Msconfig.exe  系统配置实用程序
  49. mplayer2  简易 widnows media player
  50. mspaint  画图板
  51. mstsc  远程桌面连接
  52. mplayer2  媒体播放机
  53. magnify  放大镜实用程序
  54. mmc  打开控制台
  55. mobsync  同步命令
  56. dxdiag  检查 DirectX 信息
  57. iexpress  木马捆绑工具,系统自带 58. fsmgmt.msc-----共享文件夹管理器
  58. utilman  辅助工具管理器
  59. diskmgmt.msc  磁盘管理实用程序
  60. dcomcnfg  打开系统组件服务
  61. ddeshare  打开 DDE 共享设置
  62. osk  打开屏幕键盘
  63. odbcad32   ODBC 数据源管理器
  64. oobe/msoobe /a  检查 XP 是否激活 114. logoff  --注销命令
  65. notepad  打开记事本
  66. nslookup  网络管理的工具向导
  67. ntbackup  系统备份和还原
  68. narrator  屏幕"讲述人"
  69. ntmsmgr.msc  移动存储管理器
  70. ntmsoprq.msc  移动存储管理员操作请求
  71. netstat -an  (TC)命令检查接口
  72. syncapp  创建一个公文包
  73. sysedit  系统配置编辑器
  74. sigverif  文件签名验证程序
  75. ciadv.msc  索引服务程序
  76. shrpubw  创建共享文件夹
  77. secpol.msc  本地安全策略
  78. syskey  系统加密,一旦加密就不能解开,保护 windows xp 系统的双重密码
  79. services.msc  本地服务设置
  80. Sndvol32  音量控制程序
  81. sfc.exe  系统文件检查器
  82. sfc /scannow   windows 文件保护
  83. ciadv.msc  索引服务程序
  84. tourstart   xp 简介(安装完成后出现的漫游 xp 程序)
  85. taskmgr  任务管理器
  86. eventvwr  事件查看器
  87. eudcedit  造字程序
  88. compmgmt.msc  计算机管理
  89. packager  对象包装程序
  90. perfmon.msc  计算机性能监测程序
  91. charmap  启动字符映射表
  92. cliconfg   SQL SERVER 客户端网络实用程序
  93. Clipbrd  剪贴板查看器
  94. conf  启动 netmeeting
  95. certmgr.msc  证书管理实用程序
  96. regsvr32 /u *.dll  停止 dll 文件运行
  97. regsvr32 /u zipfldr.dll  取消 ZIP 支持
  98. cmd.exe   CMD 命令提示符
  99. chkdsk.exe   Chkdsk 磁盘检查

cmd 其他命令

1、磁盘操作:

fdisk 隐含 参数 /mbr 重建主引导记录 fdisk /mbr 重建主引导记录

fdisk 在 DOS7.0 以后增加了/cmbr 参数,可在挂接多个物理硬盘时,重建排序在后面的硬盘的主引导记录,例如:fdisk /cmbr 2,可重写第二个硬盘的主引导记录。(在使用时要十分小心,避免把好的硬盘引导记录损坏)

format 参数: /q 快速格式化 /u 不可恢复 /autotest 不提示 /s 创建 MS-DOS 引导盘 format c: /q /u /autotest

2、目录操作:

DIR [目录名或文件名] [/S][/W][/P][/A] 列出目录 参数: /s 查找子目录/w 只显示文件名 /p 分页/a 显示隐藏文件 DIR format.exe /s 查找该盘的 format.exe 文件并报告位置

MD (MKDIR) [目录名] 创建目录 MKDIR HELLOWORLD 创建 HELLOWORLD 目录

CD (CHDIR) [目录名] PS:可以使用相对目录或绝对目录 进入目录 CD AA 进入当前文件夹下的 AA 目录,cd 。。 进入上一个文件夹 cd 返回根目录;cd c:windows 进入 c:windows 文件夹

RD ( RMDIR) [目录名] 删除目录 RD HELLOWORLD 删除 HELLOWORLD 目录

3、文件操作:

删除目录及其文件: rmdir [目录名或文件名] [/S][/W][/P][/A] 。例 rmdir c:qqdownload/s 删除 C 盘的 qqdownload 目录。

del [目录名或文件名] [/f][/s][/q] 删除 参数:/f 删除只读文件/s 删除该目录及其下的所有内容 /q 删除前不确认

del c:del /s /q 自动删除 c 盘的 del 目录。

copy [源文件或目录] [目标目录] 复制文件 copy d:pwin98*.* c:presetup 将 d 盘的 pwin98 的所有文件复制到 c 盘的 presetup 下。

attrib [参数][源文件或目录] 文件属性操作命令,attrib 命令可以列出或修改磁盘上文件的属性,文件属性包括文档(A)、只读(R)、隐藏(H)、系统(S),例如:attrib -h -r -s io.sys 执行这一命令后,将把 DOS 系统文件 io.sys 文件的只读、隐藏、系统属性去掉,这时将可以直接通过 dir 命令看到 io.sys 文件。attrib +h +r +s autoexec.bat 将为自动批处理文件增加以上属性。

4、内存操作:

debug 调试内存 参数 -w [文件名] 写入二进制文件 -o [地址 1] [地址 2] 输出内存 -q 退出 exp:o 70 10[return] o 71 01

[return] 01[return] q[return] DOS 下通过写 70h/71h PORT 改变 BIOS 密码在 CMOS 中存放的对应位置的值,用以清除 AWARD BIOS 密码.debug 还可以破解硬盘保护卡等,但只可以在纯 DOS 下用。

5、分区操作:

给磁盘分区,一般都会分成四个区,磁盘分区由主分区、扩展分区、逻辑分区组成。

PQ 和 Acronis Disk Director 这两个工具都可以在不丢失数据的情况下对分区进行调整大小,以及合并等操作,XP 系统的话你用 PQ,WIN7 系统的话用 Acronis Disk Director 操作基本一样,可以去网上找教程来看看,再不重装系统的情况下都能调整分区大小,但是建议你还是先备份下数据再调整,毕竟对硬盘直接进行的操作有一定的危险性。

net use ipipc$ " " /user:" " 建立 IPC 空链接

net use ipipc$ "密码" /user:"用户名" 建立 IPC 非空链接

net use h: ipc$ "密码" /user:"用户名" 直接登陆后映射对方 C:到本地为 H:

net use h: ipc$ 登陆后映射对方 C:到本地为 H:

net use ipipc$ /del 删除 IPC 链接

net use h: /del 删除映射对方到本地的为 H:的映射

net user 用户名 密码 /add 建立用户

net user guest /active:yes 激活 guest 用户

net user 查看有哪些用户

net user 帐户名 查看帐户的属性

net localgroup administrators 用户名 /add 把"用户"添加到管理员中使其具有管理员权限

net start 查看开启了哪些服务

net start 服务名 开启服务;(如:net start telnet, net start schedule)

net stop 服务名 停止某服务

net time 目标 ip 查看对方时间

net time 目标 ip /set 设置本地计算机时间与"目标 IP"主机的时间同步,加上参数/yes 可取消确认信息

net view 查看本地局域网内开启了哪些共享

net view ip 查看对方局域网内开启了哪些共享

net config 显示系统网络设置

net logoff 断开连接的共享

net pause 服务名 暂停某服务

net send ip "文本信息" 向对方发信息

net ver 局域网内正在使用的网络连接类型和信息

net share 查看本地开启的共享

net share ipc$ 开启 ipc$共享

net share ipc$ /del 删除 ipc$共享

net share c$ /del 删除 C:共享

net user guest 12345 用 guest 用户登陆后用将密码改为 12345

net password 密码 更改系统登陆密码

netstat -a 查看开启了哪些端口,常用 netstat -an

netstat -n 查看端口的网络连接情况,常用 netstat -an

netstat -v 查看正在进行的工作

netstat -p 协议名 例:netstat -p tcq/ip 查看某协议使用情况

netstat -s 查看正在使用的所有协议使用情况

nbtstat -A ip 对方 136 到 139 其中一个端口开了的话,就可查看对方最近登陆的用户名

tracert -参数 ip(或计算机名) 跟踪路由(数据包),参数:"-w 数字"用于设置超时间隔。

ping ip(或域名) 向对方主机发送默认大小为 32 字节的数据,参数:"-l[空格]数据包大小";"-n 发送数据次数";"-t"指一直 ping。

ping -t -l 65550 ip 死亡之 ping(发送大于 64K 的文件并一直 ping 就成了死亡之 ping)

ipconfig (winipcfg) 用于 windows NT 及 XP(windows 95 98)查看本地 ip 地址,ipconfig 可用参数"/all"显示全部配置信息

tlist -t 以树行列表显示进程(为系统的附加工具,默认是没有安装的,在安装目录的 Support/tools 文件夹内)

kill -F 进程名 加-F 参数后强制结束某进程(为系统的附加工具,默认是没有安装的,在安装目录的 Support/tools 文件夹内)

del -F 文件名 加-F 参数后就可删除只读文件,/AR、/AH、/AS、/AA 分别表示删除只读、隐藏、系统、存档文件,/A-R、/A-H、/A-S、/A-A 表示删除除只读、隐藏、系统、存档以外的文件。例如"DEL/AR ."表示删除当前目录下所有只读文件,"DEL/A-S ."表示删除当前目录下除系统文件以外的所有文件

del /S /Q 目录 或用:rmdir /s /Q 目录 /S 删除目录及目录下的所有子目录和文件。同时使用参数/Q 可取消删除操作时的系统确认就直接删除。(二个命令作用相同)

move 盘符路径要移动的文件名 存放移动文件的路径移动后文件名 移动文件,用参数/y 将取消确认移动目录存在相同文件的提示就直接覆盖

fc one.txt two.txt > 3st.txt 对比二个文件并把不同之处输出到 3st.txt 文件中,"> "和"> >" 是重定向命令

at id 号 开启已注册的某个计划任务

at /delete 停止所有计划任务,用参数/yes 则不需要确认就直接停止

at id 号 /delete 停止某个已注册的计划任务

at 查看所有的计划任务

at ip time 程序名(或一个命令) /r 在某时间运行对方某程序并重新启动计算机

finger username @host 查看最近有哪些用户登陆

telnet ip 端口 远和登陆服务器,默认端口为 23

open ip 连接到 IP(属 telnet 登陆后的命令)

telnet 在本机上直接键入 telnet 将进入本机的 telnet

copy 路径文件名 1  路径文件名 2 /y 复制文件 1 到指定的目录为文件 2,用参数/y 就同时取消确认你要改写一份现存目录文件

copy c:srv.exe ipadmin$ 复制本地 c:srv.exe 到对方的 admin 下

copy 1st.jpg/b+2st.txt/a 3st.jpg 将 2st.txt 的内容藏身到 1st.jpg 中生成 3st.jpg 新的文件,注:2st.txt 文件头要空三排,参数:/b 指二进制文件,/a 指 ASCLL 格式文件

copy ipadmin$svv.exe c: 或:copyipadmin$. 复制对方 admini$共享下的 srv.exe 文件(所有文件)至本地 C:

xcopy 要复制的文件或目录树 目标地址目录名 复制文件和目录树,用参数/Y 将不提示覆盖相同文件

用参数/e 才可连目录下的子目录一起复制到目标地址下。

tftp -i 自己 IP(用肉机作跳板时这用肉机 IP) get server.exec:server.exe 登陆后,将"IP"的 server.exe 下载到目标主机 c:server.exe 参数:-i 指以二进制模式传送,如传送 exe 文件时用,如不加-i 则以 ASCII 模式(传送文本文件模式)进行传送

tftp -i 对方 IP   put c:server.exe 登陆后,上传本地 c:server.exe 至主机

ftp ip 端口 用于上传文件至服务器或进行文件操作,默认端口为 21。bin 指用二进制方式传送(可执行文件进);默认为 ASCII 格式传送(文本文件时)

route print 显示出 IP 路由,将主要显示网络地址 Network addres,子网掩码 Netmask,网关地址 Gateway addres,接口地址 Interface

arp 查看和处理 ARP 缓存,ARP 是名字解析的意思,负责把一个 IP 解析成一个物理性的 MAC 地址。arp -a 将显示出全部信息

start 程序名或命令 /max 或/min 新开一个新窗口并最大化(最小化)运行某程序或命令

mem 查看 cpu 使用情况

attrib 文件名(目录名) 查看某文件(目录)的属性

attrib 文件名 -A -R -S -H 或 +A +R +S +H 去掉(添加)某文件的 存档,只读,系统,隐藏 属性;用+则是添加为某属性

dir 查看文件,参数:/Q 显示文件及目录属系统哪个用户,/T:C 显示文件创建时间,/T:A 显示文件上次被访问时间,/T:W 上次被修改时间

date /t 、 time /t 使用此参数即"DATE/T"、"TIME/T"将只显示当前日期和时间,而不必输入新日期和时间

set 指定环境变量名称=要指派给变量的字符 设置环境变量

set 显示当前所有的环境变量

set p(或其它字符) 显示出当前以字符 p(或其它字符)开头的所有环境变量

pause 暂停批处理程序,并显示出:请按任意键继续。。。。

if 在批处理程序中执行条件处理(更多说明见 if 命令及变量)

goto 标签 将 cmd.exe 导向到批处理程序中带标签的行(标签必须单独一行,且以冒号打头,例如:":start"标签)

call 路径批处理文件名 从批处理程序中调用另一个批处理程序 (更多说明见 call /?)

for 对一组文件中的每一个文件执行某个特定命令(更多说明见 for 命令及变量)

echo on 或 off 打开或关闭 echo,仅用 echo 不加参数则显示当前 echo 设置

echo 信息 在屏幕上显示出信息

echo 信息 >> pass.txt 将"信息"保存到 pass.txt 文件中

findstr "Hello" aa.txt 在 aa.txt 文件中寻找字符串 hello

find 文件名 查找某文件

title 标题名字 更改 CMD 窗口标题名字

color 颜色值 设置 cmd 控制台前景和背景颜色;0=黑、1=蓝、2=绿、3=浅绿、4=红、5=紫、6=黄、7=白、8=灰、9=淡蓝、A=淡绿、B=淡浅绿、C=淡红、D=淡紫、E=淡黄、F=亮白

prompt 名称 更改 cmd.exe 的显示的命令提示符(把 C:、D:统一改为:EntSky )

ver 在 DOS 窗口下显示版本信息

winver 弹出一个窗口显示版本信息(内存大小、系统版本、补丁版本、计算机名)

format 盘符 /FS:类型 格式化磁盘,类型:FAT、FAT32、NTFS ,例:Format D: /FS:NTFS

md  目录名 创建目录

replace 源文件 要替换文件的目录 替换文件

ren 原文件名 新文件名 重命名文件名

tree 以树形结构显示出目录,用参数-f 将列出第个文件夹中文件名称

type 文件名 显示文本文件的内容

more 文件名 逐屏显示输出文件

doskey 要锁定的命令=字符

doskey 要解锁命令= 为 DOS 提供的锁定命令(编辑命令行,重新调用 win2k 命令,并创建宏)。如:锁定 dir 命令:doskey dir=entsky (不能用 doskey dir=dir);解锁:doskey dir=

taskmgr 调出任务管理器

chkdsk /F D: 检查磁盘 D 并显示状态报告;加参数/f 并修复磁盘上的错误

tlntadmn telnt 服务 admn,键入 tlntadmn 选择 3,再选择 8,就可以更改 telnet 服务默认端口 23 为其它任何端口

exit 退出 cmd.exe 程序或目前,用参数/B 则是退出当前批处理脚本而不是 cmd.exe

path 路径可执行文件的文件名 为可执行文件设置一个路径。

cmd 启动一个 win2K 命令解释窗口。参数:/eff、/en 关闭、开启命令扩展;更我详细说明见 cmd /?

regedit /s 注册表文件名 导入注册表;参数/S 指安静模式导入,无任何提示;

regedit /e 注册表文件名 导出注册表

cacls 文件名 参数 显示或修改文件访问控制列表(ACL)——针对 NTFS 格式时。参数:/D 用户名:设定拒绝某用户访问;/P 用户名:perm 替换指定用户的访问权限;/G 用户名:perm 赋予指定用户访问权限;Perm 可以是: N 无,R 读取, W 写入, C 更改(写入),F 完全控制;例:cacls D: est.txt /D pub 设定 d: est.txt 拒绝 pub 用户访问。

cacls 文件名 查看文件的访问用户权限列表

REM 文本内容 在批处理文件中添加注解

netsh 查看或更改本地网络配置情况

简单示例

  • 1.获取和设置相关变量
bash
# 获取常用变量不需要区分大小写,使用%variable%可以获取变量值
# 获取当前目录
echo %cd%
# 获取命令搜索路径
echo %path%
# 获取当前日期
echo %date%    # 格式:2023/03/22 周三
# 获取当前时间
echo %time%  # 格式:14:26:46.97
# 获取 0 和 32767 之间的任意十进制数字
echo %random%
# 获取上一命令执行结果码
echo %errorlevel%

# 变量设置,与shell有所不同,格式如下
set [variable=[string]]  #variable表示变量名,string表示变量值
# 例
set temp="哇哈哈"
echo %temp%  # 输出:"哇哈哈"
  • 2.字符串操作
bash
# 字符串截取,命令格式 echo %var:~n,k%,
# 1."var",表示待截取字符的字符串
# 2."~"取字符标志符
# 3."n"表示字符截取起始位置
# 4."k" 表示截取几位
set temp="wahaha哇哈哈123"
echo %temp:~2,3%  # 输出:hah
echo %temp:~0,-3%  # 输出:wahaha哇哈哈

# 字符串替换,命令格式命令%var:old_str=new_str%
set replace_str=%temp:123=熏悟空%
echo %replace_str%  # 输出:wahaha哇哈哈熏悟空
echo %temp%  # 输出:wahaha哇哈哈123,不改变原值
  • 3.bat 注释 rem 注释符,也可以用两个冒号代替(:😃 rem 这是一个注释,此注释不会显示
  • 4.bat 输出语句 echo 显示信息,或启用或关闭命令回显。@字符放在命令前将关闭该命令回显,无论此时 echo 是否为打开状态
bash
# 批处理命令在执行时显示自身命令行
echo on
# 批处理命令在执行时不显示自身命令行
echo off
# 关闭echo off命令行自身的显示
@echo off
# 创建包含字符test的test.txt文件
echo test > file.txt
  • 5.基本命令
bash
# 暂停并输出“请按任意键继续. . .”
pause 等待并提示"请按任意键继续. . ."  # 阻塞窗口,程序执行完以后不会关闭窗口
pause > nul  # 等待但不出现提示语
echo wait a moment.. & pause > nul # 输出指定信息并阻塞窗口

# 程序执行结果返回码,执行成功返回0,失败返回为1
echo %errorlevel%

# 启动一个单独的窗口以运行指定的程序或命令,程序继续向下执行
start [command/program] [parameters]

# 退出CMD.EXE程序或当前批处理脚本
# 1./B:指定要退出当前批处理脚本而不是 CMD.EXE。如果从一个批处理脚本外执行,则会退出 CMD.EXE
# 2.exitCode:指定一个数字号码。如果指定了 /B,将 ERRORLEVEL设成那个数字。如果退出 CMD.EXE,则用那个数字设置过程退出代码
exit [/B] [exitCode]

# 清除屏幕内容
cls

# 提供 Windows 命令的帮助信息
help [command]

# 设置cmd窗口的标题
title 标题名字

# 设置默认的控制台前景和背景颜色
# 颜色属性由两个十六进制数字指定:第一个为背景,第二个则为前景
# 以下任意俩种颜色组合
#   0 = 黑色       8 = 灰色
#   1 = 蓝色       9 = 淡蓝色
#   2 = 绿色       A = 淡绿色
#   3 = 湖蓝色     B = 淡浅绿色
#   4 = 红色       C = 淡红色
#   5 = 紫色       D = 淡紫色
#   6 = 黄色       E = 淡黄色
#   7 = 白色       F = 亮白色
color [attr]  # attr 指定控制台输出的颜色属性

# 从一个批处理程序调用另一个批处理程序,并且不终止父批处理程序
call 路径文件名 标签

# 跳转命令。程序指针跳转到指定的标签,从标签后的第一条命令开始继续执行批处理程序
goto label  # label是参数,指定所要转向的批处理程序中的行
# 例子,打开多个cmd窗口直到资源耗尽
:label
start
goto label
  • 6.语句结构 1.if 语句
php
# if语句实现条件判断,包括字符串比较、存在判断、定义判断等。# # 通过条件判断,if语句即可以实现选择功能。
/*
1.字符串比较
  语法格式:if [/i] [not] str1 比较操作符 str2 (相关操作) [else (相关操作)]
    有/i则不区分字符串大小写;选择not项,则对判断结果进行逻辑非
比较操作符:
  1.== - 等于
  2.EQU - 等于
  3.NEQ - 不等于
  4.LSS - 小于
  5.LEQ - 小于或等于
  6.GTR - 大于
  7.GEQ - 大于或等于
*/
# 例子
set str1=123456
set str2=abcdef
if %str1%==%str2% (echo 字符串相同!) else (echo 字符串不相同!)
if /i not %str1%==%str2% (echo 字符串不相同!) else (echo 字符串相同!)

/*
2.存在判断:存在判断的功能是判断文件或文件夹是否存在
  语法格式:if [not] exist filename (相关操作) [else (相关操作)]
*/
# 例子1
if exist %0 echo 文件%0是存在的!  # %0代表该批处理的全称(包括驱动器盘符、路径、文件名和扩展类型)
# 例子2
if not exist %0(
  echo 文件夹%0不存在!
)else echo 文件夹%0存在!

/*
3.定义判断:定义判断的功能是判断变量是否存在,即是否已被定义
  语法格式:if [not] defined variable (相关操作) [else(相关操作)]
*/
# 例子1
set var=111
if defined var (echo var=%var%) else echo var尚未定义!
# 例子2
set var=% %
if defined var (echo var=%var%) else echo var尚未定义!

2.for 循环语句

bash
/*
1.无开关:无开关的for语句能够对设定的范围内进行循环,是最基本的for循环语句
  语法格式:for %%v in (循环值values)  do (相关操作)
相关解释:
  %%v是批处理程序里面的书写格式,注意v只能是单字符。在DOS中书写为%v,即只有一个百分号(%);values就是需要我们设定的循环范围,类似于C语言里面的循环变量;do后面的(相关操作)就是循环所执行的命令,即循环体
*/
# 例子1(在脚本文件中)
for %%i in (a,"b c",d,123) do echo %%i
# 例子2(在dos或者cmd窗口中)
for %i in (a,"b c",d,123) do echo %i

/*
2.开关/L:开关/L的for语句,可以根据循环值velues里面的设置进行循环,从而实现对循环次数的直接控制
  语法格式:for /L %%v in (start,step,end) do (相关操作)
相关解释:
  start为开始计数的初始值,step为每次递增的值,end为结束值。当end小于start时,step需要设置为负数。
*/
# 例子1,打印1到10(小于10)步长为2的数字
for /l %%i in (1,2,10) do @echo %%i
# 例子2(在dos或者cmd窗口使用)
for /l %i in (1,2,10) do @echo %i

/*
3.开关/f:开关/f的for语句可以解析字符串和文本
  语法格式:for  /f ["options"] %%v in (循环值values) do (相关操作)
  相关解释:
    options是(eol=c、skip=n、delims=xxx、tokens=x,y,m-n、usebackq)中的一个或多个的组合。
*/

/*
4.开关/D或/R:开关/D或/R的for语句是与目录或文件有关的命令,一般情况下很少使用。含开关/R的命令有时候被用于通过遍历文件夹来查找某一个文件或文件夹
*/

批量执行 ffmpeg 转换命令

bash
:: @echo off
:: setlocal enabledelayedexpansion

:: set "ffmpeg=C:\ffmpeg\bin\ffmpeg.exe"
:: set "input_dir=C:\input"
:: set "output_dir=C:\output"
:: set "extension=mp4"

:: for %%a in ("%input_dir%\*.%extension%") do (
::     set "input_file=%%a"
::     set "output_file=!input_file:%input_dir%=%output_dir%!"
::     set "output_file=!output_file:.%extension%=.mp4!"
::     "%ffmpeg%" -i "!input_file!" -c:v libx264 -crf 23 -preset medium -c:a aac -b:a 128k "!output_file!"
:: )

:: echo Done.
:: pause

:: 在上面的脚本中,需要设置以下变量:

:: - `ffmpeg`:FFmpeg可执行文件的路径

:: - `input_dir`:输入文件夹的路径

:: - `output_dir`:输出文件夹的路径

:: - `extension`:输入文件的扩展名

:: 脚本会遍历输入文件夹中所有扩展名为`extension`的文件,并将其转码为MP4格式,使用libx264编码器和AAC音频编码器。转码后的文件将保存在输出文件夹中,文件名与输入文件相同,扩展名为mp4。

:: 注意:在使用此脚本之前,请确保已经正确安装了FFmpeg,并将其路径设置为`ffmpeg`变量的值。


:: ffmpeg -i input.mp4 -vcodec libx264 output.mp4

for %%a in (*.flv) do ffmpeg -i "%%~a" -vcodec copy -f mp4 "%%~na.mp4"

其中(*.flv)为原始文件类型 "%%~na.mp4"为想要生成的文件类型,根据自己不同的需要自行更改。

定时关机

bash
shutdown -s -t 25000

获取目录文件名

bash
dir/b/on > mulu.txt

应用多开:微信多开

bash
@echo off
start "" "C:\Program Files (x86)\Tencent\WeChat\WeChat.exe"
start "" "C:\Program Files (x86)\Tencent\WeChat\WeChat.exe"
exit

查看机器码

bash
ECHO OFF
TITLE Check Machine Code
ECHO **********************************
ECHO [*]  Checking ALL Spoofed Serials...
Color 1A
ECHO [*] New PC Serials:
ECHO **********************************
ECHO Diskdrive Serials:
:start
cls
ECHO Hard Disk Drive Serial Number:
wmic diskdrive get serialnumber
ECHO CPU Serial Number:
wmic cpu get serialnumber
ECHO BIOS Serial Number:
wmic bios get serialnumber
ECHO Mainboard Serial Number:
wmic baseboard get serialnumber
ECHO UUID Serial Number:
wmic csproduct list full | findstr UUID
echo.
ECHO New Mac Serials:
getmac
echo Press any key to get your machine code again.
pause>nul
goto start

工作批处理

1.批量删除某一目录下的文件,该文件类型为.log 文件。

bash
@echo off
REM zaa
REM 1.0.0
REM 文件复制批处理脚本

REM 1.源文件夹
set primitive="E:\Folders\01_工作记录\08_时间轴记录\2022\20220831-杭海线-运维故障排查\TRAIN-1,TC1\Train-1-log"

echo 正在清除log文件,请稍等......
pause
:: 删除当前路径下log文件 add by zaa 2022-9-03  begin
REM 3.循环删除
del /f /s /q %primitive%\*.log
:: 删除当前路径下log文件 add by zaa 2022-9-03  end
echo 清除log文件完成!
echo. & pause

2.批量拷贝某一个目录下的文件,该文件类型为.log 文件,拷贝到另外一个指定目录。

bash
@echo off
REM zaa
REM 1.0.0
REM 文件复制批处理脚本

REM 1.源文件夹
set primitive="E:\Folders\01_工作记录\08_时间轴记录\2022\20220831-杭海线-运维故障排查\TRAIN-1,TC1\TRAIN-1,TC1"
REM 2.目的文件夹
set destination="E:\Folders\01_工作记录\08_时间轴记录\2022\20220831-杭海线-运维故障排查\TRAIN-1,TC1\Train-1-log"

echo 正在拷贝日志文件,请稍等......
pause
REM 3.循环打印
for /R %primitive% %%i in (*.log) do echo %%i
pause
REM 4.循环复制
for /R %primitive% %%f in (*.log) do copy /y "%%f" %destination%
echo 正在拷贝日志文件完成!
echo. & pause

3.定时关机程序,倒计时 5 秒。

bash
@echo off
REM zaa
REM 1.0.0
REM 文件复制批处理脚本

REM 1.设置定时关机时间
set counting_time=5

echo 正在关机,请稍等......倒计时%counting_time%秒...
pause

shutdown -s -t %counting_time%

4.批量修改一个目录下的文件的文件名,该文件原来的类型为.log 文件,修改成.txt 文件。

bash
@echo off
REM zaa
REM 1.0.0
REM 重命名文件,批处理脚本

REM 1.源文件夹
set primitive="E:\Folders\01_工作记录\08_时间轴记录\2022\20220907-长沙线-运维故障排查\pcapng"

echo 正在重命名文件,请稍等......
pause
REM 2.循环打印
for /R %primitive% %%i in (*.log) do echo %%i
pause
REM 3.先删除已经重命名过的文件,然后再重命名
for /R %primitive% %%f in (*.txt) do del /f /s /q "%%f"
pause
REM 4.循环重命名
for /R %primitive% %%f in (*.log) do ren "%%f" *.txt

echo 重命名文件完成!
echo. & pause

5.批量修改一个目录下的文件的文件名,该文件原来的类型为.log 文件。将所有文件名中"dcs"改为"supervision"。

bash
@echo off
REM zaa
REM 1.0.0
REM 重命名文件,批处理脚本

setlocal EnableDelayedExpansion
color 0a
echo %data% %time%
echo rename file now...
set a=1
pause

for /f %%i in ('dir /b *.log') do (
 set "str=%%~nxi"
 REM 这里~表示从第几位开始截取名称,~3表示从第三位开始截取,~3,7表示从第三位截取到第七位
 set "shortstr=!str:~3!"
 REM 这里是将"-"换成了"_"
 set "replacestr=!shortstr:-=_!"
 echo !replacestr!
 ren "%%i" supervision!replacestr!
 set /a a=a+1
 )
)
set /a a=a-1

echo rename finish, rename count:%a%。
echo. & pause

6.批量修改一个目录下的文件的文件名,该文件原来的类型为.log 文件。将所有文件名中"dcs"改为"supervision"。

bash
@echo off
REM zaa
REM 1.0.0
REM 重命名文件,批处理脚本
color 0a
echo %data% %time%
echo rename file now...
set a=1
pause

setlocal EnableDelayedExpansion
for /f %%i in ('dir /b *.log') do (
 set "str=%%~nxi"
 REM 这里是直接将"dcs"换成了"supervision"
 set "replacestr=!str:dcs=supervision!"
 echo !replacestr!
 ren "%%i" !replacestr!
 set /a a=a+1
 )
)
endlocal

set /a a=a-1

echo rename finish, rename count:%a%。
echo. & pause

7.给系统添加 java 环境变量,java 的安装路径为:"D:\Program Files\Java\jdk1.8.0_152"。

bash
@echo off
REM zaa
REM 1.0.0
@echo 以管理员身份运行,否则会拒绝访问系统变量
setlocal EnableDelayedExpansion
color 0a
set java_home="D:\Program Files\Java\jdk1.8.0_152"

echo %data% %time%
pause

call :addpath !java_home!
goto end

:addpath
 setx /M JAVA_HOME %1
 setx /M CLASSPATH ".;%%JAVA_HOME%%\lib;%%JAVA_HOME%%\lib\tools.jar;"
 setx /M PATH "%PATH%;%%JAVA_HOME%%\bin;%%JAVA_HOME%%\jre\bin;"
goto :eof

:end

8.批处理脚本,批量修改文件名称。

bash
@echo off
REM zaa
REM 1.0.0
REM 重命名文件,批处理脚本
setlocal EnableDelayedExpansion
color 0a
set LowerCase=supervision
set UpperCase=SUPERVISION

echo %data% %time%
echo rename file now...
set a=1
pause

for /f %%f in ('dir /b *.log') do (
 REM 这里是直接将"LowerCase"换成了"UpperCase"
 set string=%%f
    set from=!LowerCase!
    set to=!UpperCase!
    call :convert !from! !to!
    move %%f !string!
 set /a a=a+1
)
set /a a=a-1

echo rename finish, rename count:%a%。
endlocal
echo. & pause

goto end

:convert
    set string=!string:%1=%2!
goto :eof

:end

9.在文件名称后面增加序列号,从 266 开始。

bash
@echo off
REM zaa
REM 1.0.0
REM 重命名文件,批处理脚朿
color 0a
echo %data% %time%
echo deal file now...

setlocal EnableDelayedExpansion
set a=1
set filenum=266

pause

for /f %%i in ('dir /b *.jpg') do (
 REM 获取文件名,不包含后缀
 set name=%%~ni
 REM 获取文件后缀,不包含文件吿
    set ext=%%~xi
 set ext=!ext:~1!
 REM 修改文件名,加上序号
 set replacestr=!name!_!filenum!
 echo from !name!.!ext! to !replacestr!.!ext!
    move !name!.!ext! !replacestr!.!ext!
 set /a filenum=filenum+1
 set /a a=a+1
 )
)

set /a a=a-1

echo deal finish, deal count:%a%
endlocal

echo. & pause

10.在文件名称格式化,格式化为三位数字,不足补 0。

bash
@echo off
REM zaa
REM 1.0.0
REM 重命名文件,批处理脚朿
color 0a
echo %data% %time%
echo deal file now...

setlocal EnableDelayedExpansion
set a=1

pause

for /f %%i in ('dir /b *.jpg') do (
 REM 获取文件名,不包含后缀
 set name=%%~ni
 REM 获取文件后缀,不包含文件吿
    set ext=%%~xi
 set ext=!ext:~1!
 REM 修改文件名,加上序号
 Set "seq=000!name!"&Set "seq=!seq:~-3!"
 set replacestr=!seq!
 echo from !name!.!ext! to !replacestr!.!ext!
    move !name!.!ext! !replacestr!.!ext!
 set /a a=a+1
 )
)

set /a a=a-1

echo deal finish, deal count:%a%
endlocal

echo. & pause

11.去掉文件名中的特殊字符。

bash
@echo off
REM zaa
REM 1.0.0
REM 重命名文件,批处理脚朿
color 0a
echo %data% %time%
echo deal file now...

setlocal EnableDelayedExpansion
set a=2
set seq=266

pause

for /f %%i in ('dir /b *.jpg') do (
 REM 获取文件名,不包含后缀
 set name=%%~ni
 REM 获取文件后缀,不包含文件吿
    set ext=%%~xi
 set ext=!ext:~1!
 Set "replacestr=!name:20221201101420201jpg_Page=!"&Set "replacestr=!replacestr:_Image1=!"
 REM 修改文件名,加上序号
 REM set replacestr=!name!_!filenum!
 echo from !name!.!ext! to !replacestr!.!ext!, seq = !seq!
    move !name!.!ext! !replacestr!.!ext!

 set /a a=a+1
 set /a seq=seq+1
 )
)

set /a a=a-1

echo deal finish, deal count:%a%
endlocal

echo. & pause

12.增加安全网固定 ip 设置。

bash
@echo off
REM zaa
REM 1.0.0
set ipcardname="以太网 3"
netsh interface ip set address name=%ipcardname% source=static addr=10.18.203.247 mask=255.255.255.0 gateway=10.18.203.1
echo 正在设置IP: 本地连接    10.18.203.247
pause

13.添加路由表设置,双网卡双网关同时生效。

bash
@echo off
REM zaa
REM 1.0.0
route print

route delete 0.0.0.0

route delete 0.0.0.0

route delete 10.18.60.0

route delete 10.18.64.0

route delete 192.168.10.0

route delete 10.18.0.0

route add 10.18.60.0 mask 255.255.192.0 192.168.10.1 METRIC 20 -p
route add 10.18.64.0 mask 255.255.128.0 192.168.10.1 METRIC 20 -p
route add 192.168.10.0 mask 255.255.255.0 192.168.10.1 METRIC 20 -p
route add 10.18.0.0 mask 255.255.0.0 10.18.203.1 METRIC 21 -p

route print

pause

14.修改 svn 的 messages 的批处理脚本

bash
@ECHO OFF
REM zaa
REM 1.0.0
REM 修改svn log中的messages设置
:: Set all parameters. Even though most are not used, in case you want to add
:: changes that allow, for example, editing of the author or addition of log messages.
set repository="tools"
set revision="520521"
set userName="zaa"
set propertyName="svn:log"
set action="N"
set bIsEmpty="true"

:: Only allow the log message to be changed, but not author, etc.
if /I not %propertyName% == "svn:log" (
 echo %propertyName%
 goto ERROR_PROPNAME
)

:: Only allow modification of a log message, not addition or deletion.
if /I not %action% == "M" (
 echo %action%
 goto ERROR_ACTION
)
:: Make sure that the new svn:log message is not empty.
if %bIsEmpty% == "true" goto ERROR_EMPTY

goto :eof

:ERROR_EMPTY
echo Empty svn:log messages are not allowed. >&2
goto ERROR_EXIT

:ERROR_PROPNAME
echo Only changes to svn:log messages are allowed. >&2
goto ERROR_EXIT

:ERROR_ACTION
echo Only modifications to svn:log %revision% messages are allowed in the %repository% repository. >&2
goto ERROR_EXIT

:ERROR_EXIT
exit /b 1

软件卸载和绿化和激活

卸载清除

bash
@ECHO OFF&(PUSHD "%~DP0")&(REG QUERY "HKU\S-1-5-19">NUL 2>&1)||(
powershell -Command "Start-Process '%~sdpnx0' -Verb RunAs"&&EXIT)

taskkill /f /im XMP.exe >NUL 2>NUL
taskkill /f /im XLLiveUD* >NUL 2>NUL
taskkill /f /im Thunder* /T >NUL 2>NUL
taskkill /f /im xlbrowsershell* >NUL 2>NUL
taskkill /f /im DownloadSDKServer* >NUL 2>NUL

::卸载IE浏览器或IE内核程序关联组件
regsvr32 /s /u BHO\ThunderAgent.dll
regsvr32 /s /u BHO\ThunderAgent64.dll
regsvr32 /s /u Program\np_tdieplat.dll
start /wait Program\Thunder.exe -unassociate:all -unregprotocol:all

::删除防火墙入站规则
netsh advfirewall firewall delete rule name="Thunder" dir=in program="%~dp0Program\Thunder.exe" >NUL 2>NUL
netsh advfirewall firewall delete rule name="DownloadSDKServer" dir=in program="%~dp0Program\resources\bin\SDK\DownloadSDKServer.exe" >NUL 2>NUL

::清除系统后台残留文件
rd/s/q "%TEMP%\Xmp"2>NUL
rd/s/q "%TEMP%\xlwfp"2>NUL
rd/s/q "%TEMP%\Xunlei"2>NUL
rd/s/q "%TEMP%\Thunder"2>NUL
rd/s/q "%TEMP%\XLLiveUD"2>NUL
rd/s/q "%TEMP%\XLNonIESvr"2>NUL
rd/s/q "%TEMP%\ThunderLiveUD"2>NUL
rd/s/q "%TEMP%\ThunderInstall"2>NUL
rd/s/q "%TEMP%\Thunder Network"2>NUL
rd/s/q "%AppData%\迅雷" 2>NUL
rd/s/q "%AppData%\迅雷X" 2>NUL
rd/s/q "%AppData%\迅雷11" 2>NUL
rd/s/q "%AppData%\thunder"2>NUL
rd/s/q "%AppData%\thunderx"2>NUL
rd/s/q "%AppData%\XLGameBox"2>NUL
rd/s/q "%AppData%\迅雷播放组件" 2>NUL
rd/s/q "%AppData%\Thunder Network"2>NUL
rd/s/q "%ProgramData%\USOShared"2>NUL
rd/s/q "%ProgramData%\USOPrivate"2>NUL
rd/s/q "%ProgramData%\Thunder Network"2>NUL
rd/s/q "%CommonProgramW6432%\Thunder Network" 2>NUL
rd/s/q "%CommonProgramFiles(x86)%\Thunder Network"2>NUL
rd/s/q "%UserProfile%\AppData\LocalLow\XunLei"2>NUL
rd/s/q "%UserProfile%\AppData\LocalLow\XunleiBHO"2>NUL
rd/s/q "%UserProfile%\AppData\LocalLow\Thunder Network"2>NUL
del /q "%UserProfile%\AppData\APlayerCodecs3.exe" >NUL 2>NUL
del /q "%ProgramData%\APlayerCodecs3.exe" >NUL 2>NUL
rd/s/q "%PUBLIC%\Thunder Network"2>NUL
rd/s/q "%PUBLIC%\Documents\Thunder Network"2>NUL

::清除迅雷目录残留文件
del "Thunder.lnk " >NUL 2>NUL
del "Program\stat.dat" >NUL 2>NUL
del "Program\detect_stat.dat" >NUL 2>NUL
del "Program\latest_thunder_stat.xml" >NUL 2>NUL
del "Program\resources\bin\TBC\xlbrowser.ini" >NUL 2>NUL
rd /s /q "Program\resources\bin\TBC\Data"2>NUL

::清除桌面和开始菜单快捷方式
del /q "%Public%\Desktop\迅雷.lnk" >NUL 2>NUL
del /q "%UserProfile%\Desktop\迅雷.lnk" >NUL 2>NUL
rd/s/q "%AppData%\Microsoft\Windows\Start Menu\Programs\迅雷软件"2>NUL
rd/s/q "%ProgramData%\Microsoft\Windows\Start Menu\Programs\迅雷软件"2>NUL
del /q "%AppData%\Microsoft\Windows\Libraries\迅雷下载.library-ms" >NUL 2>NUL

::清除注册表相关残留键值
reg delete "HKCU\Software\Thunder Network" /f >NUL 2>NUL
reg delete "HKLM\Software\Thunder Network" /f >NUL 2>NUL
reg delete "HKLM\Software\Thunder Network" /f /reg:32 >NUL 2>NUL

reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\thunder" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\thunder" /f /reg:32 >NUL 2>NUL
reg delete "HKCU\SOFTWARE\MozillaPlugins\@xunlei.com/npxunlei;version=1.0.0.2" /f >NUL 2>NUL
reg delete "HKLM\Software\MozillaPlugins\@xunlei.com/npxunlei;version=1.0.0.2" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\MozillaPlugins\@xunlei.com/npxunlei;version=1.0.0.2" /f >NUL 2>NUL
reg delete "HKLM\Software\MozillaPlugins\@xunlei.com/npxunlei;version=1.0.0.2" /f /reg:32 >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Mozilla\NativeMessagingHosts\com.xunlei.thunder" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Mozilla\NativeMessagingHosts\com.xunlei.thunder" /f >NUL 2>NUL
reg delete "HKCU\Software\Google\Chrome\NativeMessagingHosts\com.xunlei.thunder" /f >NUL 2>NUL
reg delete "HKLM\Software\Google\Chrome\NativeMessagingHosts\com.xunlei.thunder" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Google\Chrome\NativeMessagingHosts\com.xunlei.thunder" /f /reg:32 >NUL 2>NUL
reg delete "HKCU\Software\Microsoft\Internet Explorer\MenuExt\使用迅雷下载" /f >NUL 2>NUL
reg delete "HKCU\Software\Microsoft\Internet Explorer\MenuExt\使用迅雷下载全部链接" /f >NUL 2>NUL
reg delete "HKCUHKCU\SOFTWARE\Microsoft\Internet Explorer\MenuExt\&使用&迅雷离线下载" /f >NUL 2>NUL
reg delete "HKCUHKCU\SOFTWARE\Microsoft\Internet Explorer\MenuExt\&使用&迅雷下载" /f >NUL 2>NUL
reg delete "HKCUHKCU\SOFTWARE\Microsoft\Internet Explorer\MenuExt\&使用&迅雷下载全部链接" /f >NUL 2>NUL

reg delete "HKLM\SOFTWARE\Classes\APlayer3.Player" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\APlayer3.Player.1" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\APlayerUI.Player" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\APlayerUI.Player.1" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\*\shellex\ContextMenuHandlers\AXmpLite" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\AppID\{06A28264-EF0A-48E5-AD42-1327E5328955}" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\AppID\{99DC6162-65E4-476E-87CE-9E5944D323E2}" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\AppID\{AD13FB62-BF1B-4434-9BC3-20678B5287DE}" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\AppID\ShlExt.DLL" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\AppID\UserAgent.DLL" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\AppID\XunleiBHO64.DLL" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\CLSID\{002AE4F2-96AB-4dfa-AE2E-605217F8A84C}" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\CLSID\{002AE4F2-96AB-4dfa-AE2E-605217F8A84C}" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\CLSID\{004B0726-A010-4abf-8556-FCDB7F1FCA1E}" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\CLSID\{0119CCC1-8EAC-43E9-AA7D-87F64B44AA4D}" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\CLSID\{67486EAA-ED7F-4F84-82EB-26F23F57D690}" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\CLSID\{889D2FEB-5411-4565-8998-1DD2C5261283}" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\CLSID\{8F556DA3-987D-47b0-AA88-EB8D52FE1B9A}" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\Interface\{2C543E47-732B-4EDE-8AC9-C3D27C861FAA}" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\Interface\{559BAA6F-E3FE-4B0B-90D7-2C0BFA5145F1}" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\Interface\{7BD58878-F0AE-406B-B5CE-871C4E01B237}" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\Interface\{CF1FC792-7F5C-4DB0-A00A-D209F5FFBD16}" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\MiniXmpShlExt.ContextMenuExt" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\MiniXmpShlExt.ContextMenuExt.1" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\Thunder.MyComputerIcon" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\Thunder.MyComputerIcon.1" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\TypeLib\{01560F06-CEE2-46FF-8997-308A366175E9}" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\TypeLib\{1957CD06-E83F-477D-AD1A-5F6B8C30C561}" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\TypeLib\{26D657AE-A466-4F44-AB1D-5CFFFADBED97}" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\TypeLib\{32648605-550A-40FA-8F3B-90470FF9EE1F}" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\TypeLib\{5E1356B8-3AD9-48AF-AA80-D76E5415E81B}" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\TypeLib\{64A3A559-FFBB-49BA-A947-C6104804D644}" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\TypeLib\{97830570-35FE-4195-83DE-30E79B718713}" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\TypeLib\{A9757030-96F6-485E-A8AB-5B5137462472}" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\UserAgent.Thunder59Agent" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\UserAgent.Thunder59Agent.1" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\CLSID\{1E935CBE-2951-48FE-93C8-4B7F1E5AA14E}" /f /reg:32 >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\CLSID\{22F1FF40-C53F-4360-A70E-F06540CB986B}" /f /reg:32 >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\CLSID\{23A860E9-0C41-4E01-9206-D3FC0E413645}" /f /reg:32 >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\CLSID\{485463B7-8FB2-4B3B-B29B-8B919B0EACCE}" /f /reg:32 >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\CLSID\{485463B7-8FB2-4B3B-B29B-8B919B0EACCE}" /f /reg:32 >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\CLSID\{6EE9CD3E-A386-4DAE-9737-A759DBF927AE}" /f /reg:32 >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\CLSID\{A1E760B9-78EE-4570-909A-19ABF149F31E}" /f /reg:32 >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\CLSID\{A63DEB30-9A77-492C-A380-3CA64A53C9EF}" /f /reg:32 >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\CLSID\{A9332148-C691-4B9D-91FC-B9C461DBE9DD}" /f /reg:32 >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\CLSID\{C46DFF24-22C0-4C8F-87D0-5CADE3C2ADD6}" /f /reg:32 >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\CLSID\{DE05CF4A-7B0A-4775-B5E5-396244938679}" /f /reg:32 >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\CLSID\{F19169FA-7EB8-45EB-8800-0D1F7C88F553}" /f /reg:32 >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\Interface\{2C543E47-732B-4EDE-8AC9-C3D27C861FAA}" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\Interface\{559BAA6F-E3FE-4B0B-90D7-2C0BFA5145F1}" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\Interface\{7BD58878-F0AE-406B-B5CE-871C4E01B237}" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\Interface\{C46DFF24-22C0-4C8F-87D0-5CADE3C2ADD6}" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\Interface\{CF1FC792-7F5C-4DB0-A00A-D209F5FFBD16}" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\Interface\{F19169FA-7EB8-45EB-8800-0D1F7C88F553}" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.3g2" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.3gp" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.3gp2" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.3gpp" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.aac" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.ac3" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.acc" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.aiff" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.amr" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.amv" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.ape" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.asf" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.ass" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.au" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.avi" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.bik" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.cda" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.csf" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.divx" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.dts" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.dvd" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.evo" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.f4v" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.f5v" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.flac" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.flv" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.hflv" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.hlv" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.hmkv" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.hmp4" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.letv" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.m1a" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.m1v" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.m2a" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.m2p" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.m2ts" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.m2v" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.m4a" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.m4b" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.m4p" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.m4r" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.m4v" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.mid" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.midi" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.mk5" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.mka" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.mkv" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.mod" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.mov" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.mp2" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.mp2v" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.mp3" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.mp4" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.mp5" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.mpa" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.mpc" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.mpe" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.mpeg" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.mpeg1" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.mpeg2" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.mpeg4" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.mpg" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.mpv2" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.mts" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.oga" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.ogg" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.ogm" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.ogv" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.ogx" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.pmp" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.psb" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.pva" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.qt" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.ra" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.ram" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.rm" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.rmvb" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.rpm" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.rt" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.scm" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.smi" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.smil" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.srt" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.ssa" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.sub" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.sup" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.swf" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.tp" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.tpr" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.ts" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.tta" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.usf" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.vob" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.vp6" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.wav" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.wm" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.wma" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.wmp" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.wmv" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.wv" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\xmplite.xlmv" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Clients\Media\XMPLite" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Browser Helper Objects\{004B0726-A010-4ABF-8556-FCDB7F1FCA1E}" /f >NUL 2>NUL
reg delete "HKLM\SYSTEM\CurrentControlSet\Control\Class\{5DEB2780-5239-47C2-AEB7-B8BD9BEB3F80}" /f >NUL 2>NUL
reg delete "HKLM\SYSTEM\CurrentControlSet\Control\Class\{9FB5F2D4-203E-41D2-932F-6DE145F9756C}" /f >NUL 2>NUL
reg delete "HKLM\SYSTEM\CurrentControlSet\Services\XLGuard" /f >NUL 2>NUL
reg delete "HKLM\SYSTEM\CurrentControlSet\Services\XLServicePlatform" /f >NUL 2>NUL
reg delete "HKLM\SYSTEM\CurrentControlSet\Services\XLWFP" /f >NUL 2>NUL

reg delete "HKCU\CLSID\{004B0726-A010-4abf-8556-FCDB7F1FCA1E}" /f >NUL 2>NUL
reg delete "HKCU\CLSID\{DE05CF4A-7B0A-4775-B5E5-396244938679}" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Classes\.downlist" /f >NUL 2>NUL
reg delete "HKCU\Software\Classes\.td" /f  >NUL 2>NUL
reg delete "HKCU\Software\Classes\.thunderskin" /f >NUL 2>NUL
reg delete "HKCU\Software\Classes\.torrent" /f >NUL 2>NUL
reg delete "HKCU\Software\Classes\.xlb" /f >NUL 2>NUL
reg delete "HKCU\Software\Classes\.xltd" /f >NUL 2>NUL
reg delete "HKCU\Software\Classes\ed2k" /f >NUL 2>NUL
reg delete "HKCU\Software\Classes\magnet" /f >NUL 2>NUL
reg delete "HKCU\Software\Classes\thunder" /f >NUL 2>NUL
reg delete "HKCU\Software\Classes\thunderx" /f >NUL 2>NUL
reg delete "HKCU\Software\Classes\xlb" /f >NUL 2>NUL
reg delete "HKCU\Software\Classes\Xunlei.Bittorrent.6" /f >NUL 2>NUL
reg delete "HKCU\Software\Classes\Xunlei.LSTFile.6" /f >NUL 2>NUL
reg delete "HKCU\Software\Classes\Xunlei.TDFile.6" /f >NUL 2>NUL
reg delete "HKCU\Software\Classes\Xunlei.ThunderSkin.6" /f >NUL 2>NUL
reg delete "HKCU\Software\Classes\Xunlei.XLB.6" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.torrent\OpenWithProgids" /f /v "Xunlei.Bittorrent.6" >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.xltd\OpenWithList" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.xltd\OpenWithProgids" /v "Xunlei.TDFile.6" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Mozilla\NativeMessagingHosts\com.xunlei.thunder" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\MozillaPlugins\@xunlei.com" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Thunder Network" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Ext\Stats\{002AE4F2-96AB-4dfa-AE2E-605217F8A84C}" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Ext\Stats\{485463B7-8FB2-4B3B-B29B-8B919B0EACCE}" /f >NUL 2>NUL

reg delete "HKCR\.td" /f >NUL 2>NUL
reg delete "HKCR\xlb" /f >NUL 2>NUL
reg delete "HKCR\.xlb" /f >NUL 2>NUL
reg delete "HKCR\.xltd" /f >NUL 2>NUL
reg delete "HKCR\ed2k" /f >NUL 2>NUL
reg delete "HKCR\magnet" /f >NUL 2>NUL
reg delete "HKCR\thunder" /f >NUL 2>NUL
reg delete "HKCR\thunderx" /f >NUL 2>NUL
reg delete "HKCR\.torrent" /f >NUL 2>NUL
reg delete "HKCR\.downlist" /f >NUL 2>NUL
reg delete "HKCR\.thunderskin" /f >NUL 2>NUL
reg delete "HKCR\ThunderSkin.6" /f >NUL 2>NUL
reg delete "HKCR\Xunlei.XLB.6" /f >NUL 2>NUL
reg delete "HKCR\Xunlei.TDFile.6" /f >NUL 2>NUL
reg delete "HKCR\Xunlei.LSTFile.6" /f >NUL 2>NUL
reg delete "HKCR\Xunlei.Bittorrent.6" /f >NUL 2>NUL
reg delete "HKCR\Xunlei.ThunderSkin.6" /f >NUL 2>NUL

reg delete "HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /f /v "%~dp0Program\Thunder.exe" >NUL 2>NUL


CLS&ECHO.&ECHO 清除完成,确认删除?
ECHO.&ECHO 1、删除软件保留用户数据
ECHO.&ECHO 2、删除软件以及用户数据

CHOICE /C 12 /N >NUL 2>NUL

IF "%ERRORLEVEL%"=="2" (
  DEL /F/Q "%~dp0BHO\ThunderAgent*.dll" >NUL 2>NUL
  IF EXIST "%~dp0BHO\ThunderAgent.dll" ren "%~dp0BHO\ThunderAgent.dll" "ThunderAgent.dll.%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%.tmp" >NUL 2>NUL
  IF EXIST "%~dp0BHO\ThunderAgent64.dll" ren "%~dp0BHO\ThunderAgent64.dll" "ThunderAgent64.dll.%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%.tmp" >NUL 2>NUL
  PUSHD .. & RD /S/Q "%~DP0" 2>NUL)

IF "%ERRORLEVEL%"=="1" (
  DEL /F/Q "%~dp0BHO\ThunderAgent*.dll" >NUL 2>NUL
  IF EXIST "%~dp0BHO\ThunderAgent.dll" ren "%~dp0BHO\ThunderAgent.dll" "ThunderAgent.dll.%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%.tmp" >NUL 2>NUL
  IF EXIST "%~dp0BHO\ThunderAgent64.dll" ren "%~dp0BHO\ThunderAgent64.dll" "ThunderAgent64.dll.%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%.tmp" >NUL 2>NUL
  IF EXIST "profiles" (
    FOR /F "delims=*" %%a IN ('dir /a/b *.*^|findstr /v /i "profiles$"') DO (
    RD /S/Q "%%a" 2>NUL & DEL /F/Q "%%a" >NUL 2>NUL)
    ) ELSE (
    PUSHD .. & RD /S/Q "%~DP0" 2>NUL))



@ECHO OFF&(PUSHD "%~DP0")&(REG QUERY "HKU\S-1-5-19">NUL 2>&1)||(
powershell -Command "Start-Process '%~sdpnx0' -Verb RunAs"&&EXIT)

taskkill /f /im 2345P* >NUL 2>NUL
if exist 2345PicLoader.exe start "" /wait "%~dp02345PicLoader.exe" -preUninstall -invoke-platform-x64
if exist 2345PicLoader.exe start "" /wait "%~dp02345PicLoader.exe" -uninstall -invoke-platform-x64

if exist 2345ImageThumb.dll regsvr32 /s /u 2345ImageThumb.dll
if exist 2345ImageThumb64.dll regsvr32 /s /u 2345ImageThumb64.dll

rd /s/q "%TEMP%\2345Pic"2>NUL
rd /s/q "%AppData%\2345Pic"2>NUL
rd /s/q "%AppData%\Helper_2345"2>NUL

ver|findstr "5\.[0-9]\.[0-9][0-9]*" >NUL && (
del/q "%UserProfile%\桌面\看图王.lnk" >NUL 2>NUL
del/q "%AllUsersProfile%\桌面\看图王.lnk" >NUL 2>NUL
rd/s/q "%UserProfile%\「开始」菜单\程序\看图王"2>NUL
rd/s/q "%AllUsersProfile%\「开始」菜单\程序\看图王"2>NUL )

ver|findstr "\<6\.[0-9]\.[0-9][0-9]*\> \<10\.[0-9]\.[0-9][0-9]*\>" >NUL && (
del/q "%Public%\Desktop\看图王.lnk" >NUL 2>NUL
del/q "%UserProfile%\Desktop\看图王.lnk" >NUL 2>NUL
rd/s/q "%AppData%\Microsoft\Windows\Start Menu\Programs\看图王"2>NUL
rd/s/q "%ProgramData%\Microsoft\Windows\Start Menu\Programs\看图王"2>NUL )

reg delete "HKLM\SOFTWARE\2345Pic" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\2345Pic" /f /reg:32 >NUL 2>NUL
reg delete "HKCU\Software\2345.com" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\RegisteredApplications" /v "2345Pic" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\2345PicViewer.exe" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\2345Pic" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\2345Pic" /f /reg:32 >NUL 2>NUL

ECHO.&ECHO 清除完成,删除软件? [敲1]
ECHO.&ECHO Modded by www.x6g.com

CHOICE /C 1 /N >NUL 2>NUL
IF "%ERRORLEVEL%"=="1" (
  DEL /F/Q "2345ImageThumb*.dll" >NUL 2>NUL
  IF EXIST 2345ImageThumb.dll ren 2345ImageThumb.dll "2345ImageThumb.dll.%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%.tmp" >NUL 2>NUL
  IF EXIST 2345ImageThumb64.dll ren 2345ImageThumb64.dll "2345ImageThumb64.dll.%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%.tmp" >NUL 2>NUL
  PUSHD .. & RD /S/Q "%~DP0" >NUL 2>NUL )



# 第二种
@ECHO OFF&(PUSHD "%~DP0")&(REG QUERY "HKU\S-1-5-19">NUL 2>&1)||(
powershell -Command "Start-Process '%~sdpnx0' -Verb RunAs"&&EXIT)

taskkill /f /im KwW* >NUL 2>NUL
taskkill /f /im KwMusic* >NUL 2>NUL
taskkill /f /im KwWebKit*  >NUL 2>NUL
taskkill /f /im KwService* >NUL 2>NUL
taskkill /f /im runshelldraw* >NUL 2>NUL
taskkill /f /im WriteMbox.exe >NUL 2>NUL
taskkill /f /im KwKnowSong.exe >NUL 2>NUL

rd/s/q "%temp%\KWMUSIC" 2>NUL
rd/s/q "%AppData%\kuwodata" 2>NUL
ver|findstr "5\.[0-9]\.[0-9][0-9]*" >NUL && (
rd/s/q "%AllUsersProfile%\Application Data\Kuwodata" 2>NUL
rd/s/q "%UserProfile%\Local Settings\Application Data\kwmusic" 2>NUL
del/q "%UserProfile%\桌面\酷我音乐.lnk" >NUL 2>NUL
del/q "%AllUsersProfile%\桌面\酷我音乐.lnk" >NUL 2>NUL
rd/s/q "%UserProfile%\「开始」菜单\程序\酷我音乐"2>NUL
rd/s/q "%AllUsersProfile%\「开始」菜单\程序\酷我音乐"2>NUL
)
ver|findstr "\<6\.[0-9]\.[0-9][0-9]*\> \<10\.[0-9]\.[0-9][0-9]*\>" >NUL && (
rd/s/q "%ProgramData%\kuwodata" 2>NUL
rd/s/q "%UserProfile%\AppData\Local\kwmusic" 2>NUL
del/q "%Public%\Desktop\酷我音乐.lnk" >NUL 2>NUL
del/q "%UserProfile%\Desktop\酷我音乐.lnk" >NUL 2>NUL
rd/s/q "%AppData%\Microsoft\Windows\Start Menu\Programs\酷我音乐"2>NUL
rd/s/q "%ProgramData%\Microsoft\Windows\Start Menu\Programs\酷我音乐"2>NUL
)
reg delete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /f /v "kwmusic" >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /f /v "kwmusic" >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /f /v "kwmusic" /reg:32 >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\KwMusic" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\KwMusic" /f /reg:32 >NUL 2>NUL

reg delete "HKLM\SOFTWARE\Classes\CLSID\{C190FFCA-1E3C-4C52-AAFF-01AD4CF394E0}" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\Directory\shell\kwopen" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\Directory\shell\kwplaylist" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\kuwo" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Clients\Media\KwMusic" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Clients\Media\KwMusic" /f /reg:32 >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\kwfile_AAC" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\kwfile_AC3" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\kwfile_ape" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\kwfile_CDA" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\kwfile_CUE" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\kwfile_DFF" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\kwfile_dks" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\kwfile_DSF" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\kwfile_FLAC" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\kwfile_KWM" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\kwfile_lrc" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\kwfile_lrcx" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\kwfile_M4A" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\kwfile_MP1" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\kwfile_MP2" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\kwfile_MP3" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\kwfile_OGG" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\kwfile_OPUS" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\kwfile_TTA" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\kwfile_WAV" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\kwfile_wma" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\kwfile_WV" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Classes\kwfile_AAC" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Classes\kwfile_AC3" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Classes\kwfile_ape" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Classes\kwfile_CDA" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Classes\kwfile_CUE" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Classes\kwfile_DFF" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Classes\kwfile_DSF" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Classes\kwfile_FLAC" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Classes\kwfile_KWM" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Classes\kwfile_M4A" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Classes\kwfile_MP1" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Classes\kwfile_MP2" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Classes\kwfile_MP3" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Classes\kwfile_OGG" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Classes\kwfile_OPUS" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Classes\kwfile_TTA" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Classes\kwfile_WAV" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Classes\kwfile_wma" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Classes\kwfile_WV" /f >NUL 2>NUL

for %%a in (c d e f h i j k l m n o) do rd/s/q "%%a:\KwDownload\temp"2>NUL

:BEGIN
IF EXIST "%WinDir%\System32\CHOICE.exe" (
CLS&ECHO.&ECHO 清除完成,删除软件?[1]
CHOICE /C 1 /N >NUL 2>NUL
IF "%ERRORLEVEL%"=="1" PUSHD .. & RD /S/Q "%~DP0" 2>NUL
) ELSE (
CLS&ECHO.&SET /P enter=清除完成,删除软件?[敲Y回车] )
IF /I "%enter%"=="Y" PUSHD ..  & RD /S/Q "%~DP0" 2>NUL
ECHO.&ECHO 输入无效 &PING 127.1 /n 2 >NUL&GOTO BEGIN

绿化

bash
@ECHO OFF
REG QUERY "HKU\S-1-5-19">NUL 2>&1 || (
reg add "HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /f /v "%~dp0Program\Thunder.exe" /d "~ RUNASADMIN" >NUL 2>NUL
)
REG QUERY "HKU\S-1-5-19">NUL 2>&1 || (powershell -Command "Start-Process '%~sdpnx0' -Verb RunAs"&&EXIT)

ver|findstr "5\.[0-9]\.[0-9][0-9]*" > NUL && (
ECHO.&ECHO 当前版本不支持WinXP &PAUSE>NUL&EXIT)

taskkill /f /im XMP.exe >NUL 2>NUL
taskkill /f /im XLLiveUD* >NUL 2>NUL
taskkill /f /im Thunder* /T >NUL 2>NUL
taskkill /f /im xlbrowsershell* >NUL 2>NUL
taskkill /f /im DownloadSDKServer* >NUL 2>NUL

::删除相关残留文件
rd/s/q "%TEMP%\Xmp"2>NUL
rd/s/q "%TEMP%\xlwfp"2>NUL
rd/s/q "%TEMP%\Xunlei"2>NUL
rd/s/q "%TEMP%\Thunder"2>NUL
rd/s/q "%TEMP%\XLLiveUD"2>NUL
rd/s/q "%TEMP%\XLNonIESvr"2>NUL
rd/s/q "%TEMP%\ThunderLiveUD"2>NUL
rd/s/q "%TEMP%\ThunderInstall"2>NUL
rd/s/q "%TEMP%\Thunder Network"2>NUL
rd/s/q "%AppData%\迅雷" 2>NUL
rd/s/q "%AppData%\迅雷X" 2>NUL
rd/s/q "%AppData%\迅雷11" 2>NUL
rd/s/q "%AppData%\thunder"2>NUL
rd/s/q "%AppData%\thunderx"2>NUL
rd/s/q "%AppData%\XLGameBox"2>NUL
rd/s/q "%AppData%\迅雷播放组件" 2>NUL
rd/s/q "%AppData%\Thunder Network"2>NUL
rd/s/q "%ProgramData%\USOShared"2>NUL
rd/s/q "%ProgramData%\USOPrivate"2>NUL
rd/s/q "%ProgramData%\Thunder Network"2>NUL
rd/s/q "%PUBLIC%\Documents\Thunder Network"2>NUL
rd/s/q "%CommonProgramW6432%\Thunder Network"2>NUL
del/q "%ProgramData%\APlayerCodecs3.exe" >NUL 2>NUL
rd/s/q "%CommonProgramFiles(x86)%\Thunder Network"2>NUL
rd/s/q "%UserProfile%\AppData\LocalLow\XunLei"2>NUL
rd/s/q "%UserProfile%\AppData\LocalLow\XunleiBHO"2>NUL
del/q "%UserProfile%\AppData\APlayerCodecs3.exe" >NUL 2>NUL
rd/s/q "%UserProfile%\AppData\LocalLow\Thunder Network"2>NUL
del/q "%AppData%\Microsoft\Windows\Libraries\迅雷下载.library-ms" >NUL 2>NUL

::允许防火墙入站规则
netsh advfirewall firewall add rule name="Thunder" dir=in action=allow program="%~dp0Program\Thunder.exe" >NUL 2>NUL
netsh advfirewall firewall add rule name="DownloadSDKServer" dir=in action=allow program="%~dp0Program\resources\bin\SDK\DownloadSDKServer.exe" >NUL 2>NUL

::阻止后台P2P偷偷上传
rd/s/q "%PUBLIC%\Thunder Network"2>NUL
md "%PUBLIC%\Thunder Network\cid_store.dat" 2>NUL
md "%PUBLIC%\Thunder Network\tp_common_info.dat" 2>NUL
md "%PUBLIC%\Thunder Network\emule_upload_list.dat" 2>NUL

::迅雷所在位置检测标记
IF NOT EXIST "%ProgramW6432%" (
reg add "HKLM\SOFTWARE\Thunder Network\ThunderOem\thunder_backwnd" /f /v "dir" /d "%~dp0\" >NUL 2>NUL
reg add "HKLM\SOFTWARE\Thunder Network\ThunderOem\thunder_backwnd" /f /v "instdir" /d "%~dp0\" >NUL 2>NUL
reg add "HKLM\SOFTWARE\Thunder Network\ThunderOem\thunder_backwnd" /f /v "Path" /d "%~dp0Program\Thunder.exe" >NUL 2>NUL
) ELSE (
reg add "HKLM\SOFTWARE\Thunder Network\ThunderOem\thunder_backwnd" /f /v "dir" /d "%~dp0\" /reg:32 >NUL 2>NUL
reg add "HKLM\SOFTWARE\Thunder Network\ThunderOem\thunder_backwnd" /f /v "instdir" /d "%~dp0\" /reg:32 >NUL 2>NUL
reg add "HKLM\SOFTWARE\Thunder Network\ThunderOem\thunder_backwnd" /f /v "Path" /d "%~dp0Program\Thunder.exe" /reg:32 >NUL 2>NUL
)

::注册IE浏览器或基于IE内核程序关联组件
regsvr32 /s "%~dp0BHO\ThunderAgent.dll"
regsvr32 /s "%~dp0BHO\ThunderAgent64.dll"
regsvr32 /s "%~dp0Program\np_tdieplat.dll"
reg add "HKCU\Software\Thunder Network\BHOEnum" /f /v "Thunder7" /d "%~dp0BHO\" >NUL 2>NUL

::迅雷播放组件相关键值
reg add "HKCU\SOFTWARE\Thunder Network\Xmp" /f /v "XmpCodecsState" /t REG_DWORD /d "4" >NUL 2>NUL
reg add "HKCU\SOFTWARE\Thunder Network\APlayer" /f /v "XmpCodecsState" /t REG_DWORD /d "4" >NUL 2>NUL
reg add "HKCU\SOFTWARE\Thunder Network\APlayer" /f /v "XmpCodecsUpdateState" /t REG_DWORD /d "4" >NUL 2>NUL

::Chrme, firefox扩展检测识别路径键值项
reg delete "HKLM\SOFTWARE\Google\Chrome\NativeMessagingHosts\com.xunlei.thunder" /f /reg:32 >NUL 2>NUL
reg add "HKLM\SOFTWARE\Google\Chrome\NativeMessagingHosts\com.xunlei.thunder" /f /ve /d "%~dp0Program\com.xunlei.thunder.json" >NUL 2>NUL
IF NOT EXIST "%ProgramW6432%" (
reg add "HKLM\SOFTWARE\MozillaPlugins\@xunlei.com/npxunlei;version=1.0.0.2" /f /v "path" /d "%~dp0Program\npxunlei.dll" >NUL 2>NUL
) ELSE (
reg add "HKLM\SOFTWARE\MozillaPlugins\@xunlei.com/npxunlei;version=1.0.0.2" /f /v "path" /d "%~dp0Program\npxunlei.dll" /reg:32 >NUL 2>NUL
)

::添加网页右键菜单下载项
reg add "HKCU\SOFTWARE\Microsoft\Internet Explorer\MenuExt\&使用&迅雷离线下载" /f /ve /d "%~dp0BHO\OfflineDownload.htm" >NUL 2>NUL
reg add "HKCU\SOFTWARE\Microsoft\Internet Explorer\MenuExt\&使用&迅雷离线下载" /f /v "Contexts" /t REG_DWORD /d "34" >NUL 2>NUL
reg add "HKCU\SOFTWARE\Microsoft\Internet Explorer\MenuExt\&使用&迅雷离线下载" /f /v "Name" /d "xl_offlinedownload" >NUL 2>NUL
reg add "HKCU\SOFTWARE\Microsoft\Internet Explorer\MenuExt\&使用&迅雷下载" /f /ve /d "%~dp0BHO\geturl.htm" >NUL 2>NUL
reg add "HKCU\SOFTWARE\Microsoft\Internet Explorer\MenuExt\&使用&迅雷下载" /f /v "Contexts" /t REG_DWORD /d "34" >NUL 2>NUL
reg add "HKCU\SOFTWARE\Microsoft\Internet Explorer\MenuExt\&使用&迅雷下载" /f /v "Name" /d "xl_geturl" >NUL 2>NUL
reg add "HKCU\SOFTWARE\Microsoft\Internet Explorer\MenuExt\&使用&迅雷下载全部链接" /f /ve /d "%~dp0BHO\GetAllUrl.htm" >NUL 2>NUL
reg add "HKCU\SOFTWARE\Microsoft\Internet Explorer\MenuExt\&使用&迅雷下载全部链接" /f /v "Contexts" /t REG_DWORD /d "243" >NUL 2>NUL
reg add "HKCU\SOFTWARE\Microsoft\Internet Explorer\MenuExt\&使用&迅雷下载全部链接" /f /v "Name" /d "xl_getallurl" >NUL 2>NUL

::关联相关的文件类型协议

reg add "HKCR\.downlist" /f /ve /d "Xunlei.LSTFile.6" >NUL 2>NUL
reg add "HKCR\.td" /f /ve /d "Xunlei.TDFile.6" >NUL 2>NUL
reg add "HKCR\.thunderskin" /f /ve /d "Xunlei.ThunderSkin.6" >NUL 2>NUL
reg add "HKCR\.torrent" /f /ve /d "Xunlei.Bittorrent.6" >NUL 2>NUL
reg add "HKCR\.xlb" /f /ve /d "Xunlei.XLB.6" >NUL 2>NUL
reg add "HKCR\.xltd" /f /ve /d "Xunlei.TDFile.6" >NUL 2>NUL
reg add "HKCR\ed2k" /f /v "URL Protocol" /d "" >NUL 2>NUL
reg add "HKCR\ed2k\Shell\Open\command" /f /ve /d "\"%~dp0Program\Thunder.exe\" \"%%1\" -StartType:ed2k" >NUL 2>NUL
reg add "HKCR\magnet" /f /v "URL Protocol" /d "" >NUL 2>NUL
reg add "HKCR\magnet\Shell\Open\command" /f /ve /d "\"%~dp0Program\Thunder.exe\" \"%%1\" -StartType:magnet" >NUL 2>NUL
reg add "HKCR\thunder" /f /v "URL Protocol" /d "" >NUL 2>NUL
reg add "HKCR\thunder\Shell\Open\command" /f /ve /d "\"%~dp0Program\Thunder.exe\" \"%%1\" -StartType:thunder" >NUL 2>NUL
reg add "HKCR\thunderx" /f /v "URL Protocol" /d "" >NUL 2>NUL
reg add "HKCR\thunderx\Shell\Open\command" /f /ve /d "\"%~dp0Program\Thunder.exe\" \"%%1\" -StartType:thunderx" >NUL 2>NUL
reg add "HKCR\xlb" /f /v "URL Protocol" /d "" >NUL 2>NUL
reg add "HKCR\xlb\Shell\Open\command" /f /ve /d "\"%~dp0Program\Thunder.exe\" \"%%1\" -StartType:xlb" >NUL 2>NUL
reg add "HKCR\Xunlei.Bittorrent.6" /f /ve /d "BT种子文件" >NUL 2>NUL
reg add "HKCR\Xunlei.Bittorrent.6\DefaultIcon" /f /ve /d "%~dp0Program\TorrentFile.ico" >NUL 2>NUL
reg add "HKCR\Xunlei.Bittorrent.6\Shell\Open" /f /ve /d "使用迅雷下载该BT文件" >NUL 2>NUL
reg add "HKCR\Xunlei.Bittorrent.6\Shell\Open\command" /f /ve /d "\"%~dp0Program\Thunder.exe\" \"%%1\"" >NUL 2>NUL
reg add "HKCR\Xunlei.LSTFile.6" /f /ve /d "迅雷专有下载文件" >NUL 2>NUL
reg add "HKCR\Xunlei.LSTFile.6\DefaultIcon" /f /ve /d "%~dp0Program\XLDownloadList.ico" >NUL 2>NUL
reg add "HKCR\Xunlei.LSTFile.6\Shell\Open" /f /ve /d "使用迅雷下载该任务列表文件" >NUL 2>NUL
reg add "HKCR\Xunlei.LSTFile.6\Shell\Open\command" /f /ve /d "\"%~dp0Program\Thunder.exe\" \"%%1\"" >NUL 2>NUL
reg add "HKCR\Xunlei.TDFile.6" /f /ve /d "迅雷临时数据文件" >NUL 2>NUL
reg add "HKCR\Xunlei.TDFile.6\DefaultIcon" /f /ve /d "%~dp0Program\XLTempFile.ico" >NUL 2>NUL
reg add "HKCR\Xunlei.TDFile.6\Shell\Open" /f /ve /d "使用迅雷下载未完成文件" >NUL 2>NUL
reg add "HKCR\Xunlei.TDFile.6\Shell\Open\command" /f /ve /d "\"%~dp0Program\Thunder.exe\" \"%%1\"" >NUL 2>NUL
reg add "HKCR\Xunlei.ThunderSkin.6" /f /ve /d "迅雷X皮肤文件" >NUL 2>NUL
reg add "HKCR\Xunlei.ThunderSkin.6\DefaultIcon" /f /ve /d "%~dp0Program\thunderskin.ico" >NUL 2>NUL
reg add "HKCR\Xunlei.ThunderSkin.6\Shell\Open" /f /ve /d "为迅雷X应用该皮肤" >NUL 2>NUL
reg add "HKCR\Xunlei.ThunderSkin.6\Shell\Open\command" /f /ve /d "\"%~dp0Program\Thunder.exe\" \"%%1\"" >NUL 2>NUL
reg add "HKCR\Xunlei.XLB.6" /f /ve /d "迅雷下载合集文件" >NUL 2>NUL
reg add "HKCR\Xunlei.XLB.6\DefaultIcon" /f /ve /d "%~dp0Program\DownloadCollection.ico" >NUL 2>NUL
reg add "HKCR\Xunlei.XLB.6\Shell\Open" /f /ve /d "使用迅雷查看该下载合集文件" >NUL 2>NUL
reg add "HKCR\Xunlei.XLB.6\Shell\Open\command" /f /ve /d "\"%~dp0Program\Thunder.exe\" \"%%1\"" >NUL 2>NUL


reg add "HKCU\Software\Classes\.downlist" /f /ve /d "Xunlei.LSTFile.6" >NUL 2>NUL
reg add "HKCU\Software\Classes\.td" /f /ve /d "Xunlei.TDFile.6" >NUL 2>NUL
reg add "HKCU\Software\Classes\.thunderskin" /f /ve /d "Xunlei.ThunderSkin.6" >NUL 2>NUL
reg add "HKCU\Software\Classes\.torrent" /f /ve /d "Xunlei.Bittorrent.6" >NUL 2>NUL
reg add "HKCU\Software\Classes\.xlb" /f /ve /d "Xunlei.XLB.6" >NUL 2>NUL
reg add "HKCU\Software\Classes\.xltd" /f /ve /d "Xunlei.TDFile.6" >NUL 2>NUL
reg add "HKCU\Software\Classes\ed2k" /f /v "URL Protocol" /d "" >NUL 2>NUL
reg add "HKCU\Software\Classes\ed2k\Shell\Open\command" /f /ve /d "\"%~dp0Program\Thunder.exe\" \"%%1\" -StartType:ed2k" >NUL 2>NUL
reg add "HKCU\Software\Classes\magnet" /f /v "URL Protocol" /d "" >NUL 2>NUL
reg add "HKCU\Software\Classes\magnet\Shell\Open\command" /f /ve /d "\"%~dp0Program\Thunder.exe\" \"%%1\" -StartType:magnet" >NUL 2>NUL
reg add "HKCU\Software\Classes\thunder" /f /v "URL Protocol" /d "" >NUL 2>NUL
reg add "HKCU\Software\Classes\thunder\Shell\Open\command" /f /ve /d "\"%~dp0Program\Thunder.exe\" \"%%1\" -StartType:thunder" >NUL 2>NUL
reg add "HKCU\Software\Classes\thunderx" /f /v "URL Protocol" /d "" >NUL 2>NUL
reg add "HKCU\Software\Classes\thunderx\Shell\Open\command" /f /ve /d "\"%~dp0Program\Thunder.exe\" \"%%1\" -StartType:thunderx" >NUL 2>NUL
reg add "HKCU\Software\Classes\xlb" /f /v "URL Protocol" /d "" >NUL 2>NUL
reg add "HKCU\Software\Classes\xlb\Shell\Open\command" /f /ve /d "\"%~dp0Program\Thunder.exe\" \"%%1\" -StartType:xlb" >NUL 2>NUL
reg add "HKCU\Software\Classes\Xunlei.Bittorrent.6" /f /ve /d "BT种子文件" >NUL 2>NUL
reg add "HKCU\Software\Classes\Xunlei.Bittorrent.6\DefaultIcon" /f /ve /d "%~dp0Program\TorrentFile.ico" >NUL 2>NUL
reg add "HKCU\Software\Classes\Xunlei.Bittorrent.6\Shell\Open" /f /ve /d "使用迅雷下载该BT文件" >NUL 2>NUL
reg add "HKCU\Software\Classes\Xunlei.Bittorrent.6\Shell\Open\command" /f /ve /d "\"%~dp0Program\Thunder.exe\" \"%%1\"" >NUL 2>NUL
reg add "HKCU\Software\Classes\Xunlei.LSTFile.6" /f /ve /d "迅雷专有下载文件" >NUL 2>NUL
reg add "HKCU\Software\Classes\Xunlei.LSTFile.6\DefaultIcon" /f /ve /d "%~dp0Program\XLDownloadList.ico" >NUL 2>NUL
reg add "HKCU\Software\Classes\Xunlei.LSTFile.6\Shell\Open" /f /ve /d "使用迅雷下载该任务列表文件" >NUL 2>NUL
reg add "HKCU\Software\Classes\Xunlei.LSTFile.6\Shell\Open\command" /f /ve /d "\"%~dp0Program\Thunder.exe\" \"%%1\"" >NUL 2>NUL
reg add "HKCU\Software\Classes\Xunlei.TDFile.6" /f /ve /d "迅雷临时数据文件" >NUL 2>NUL
reg add "HKCU\Software\Classes\Xunlei.TDFile.6\DefaultIcon" /f /ve /d "%~dp0Program\XLTempFile.ico" >NUL 2>NUL
reg add "HKCU\Software\Classes\Xunlei.TDFile.6\Shell\Open" /f /ve /d "使用迅雷下载未完成文件" >NUL 2>NUL
reg add "HKCU\Software\Classes\Xunlei.TDFile.6\Shell\Open\command" /f /ve /d "\"%~dp0Program\Thunder.exe\" \"%%1\"" >NUL 2>NUL
reg add "HKCU\Software\Classes\Xunlei.ThunderSkin.6" /f /ve /d "迅雷X皮肤文件" >NUL 2>NUL
reg add "HKCU\Software\Classes\Xunlei.ThunderSkin.6\DefaultIcon" /f /ve /d "%~dp0Program\thunderskin.ico" >NUL 2>NUL
reg add "HKCU\Software\Classes\Xunlei.ThunderSkin.6\Shell\Open" /f /ve /d "为迅雷X应用该皮肤" >NUL 2>NUL
reg add "HKCU\Software\Classes\Xunlei.ThunderSkin.6\Shell\Open\command" /f /ve /d "\"%~dp0Program\Thunder.exe\" \"%%1\"" >NUL 2>NUL
reg add "HKCU\Software\Classes\Xunlei.XLB.6" /f /ve /d "迅雷下载合集文件" >NUL 2>NUL
reg add "HKCU\Software\Classes\Xunlei.XLB.6\DefaultIcon" /f /ve /d "%~dp0Program\DownloadCollection.ico" >NUL 2>NUL
reg add "HKCU\Software\Classes\Xunlei.XLB.6\Shell\Open" /f /ve /d "使用迅雷查看该下载合集文件" >NUL 2>NUL
reg add "HKCU\Software\Classes\Xunlei.XLB.6\Shell\Open\command" /f /ve /d "\"%~dp0Program\Thunder.exe\" \"%%1\"" >NUL 2>NUL

ASSOC .=. >NUL 2>NUL

::创建桌面和根目录快捷方式
mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(a.SpecialFolders(""%~sdp0\"") & ""Thunder.lnk""):b.TargetPath=""%~sdp0Program\Thunder.exe"":b.WorkingDirectory=""%~sdp0"":b.Save:close")
mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(a.SpecialFolders(""Desktop"") & ""\迅雷.lnk""):b.TargetPath=""%~sdp0Program\Thunder.exe"":b.WorkingDirectory=""%~sdp0Program"":b.Save:close")

ECHO.&ECHO 完成 &TIMEOUT /t 2 >NUL&EXIT




# 第2种
@ECHO OFF&(PUSHD "%~DP0")&(REG QUERY "HKU\S-1-5-19">NUL 2>&1)||(
powershell -Command "Start-Process '%~sdpnx0' -Verb RunAs"&&EXIT)

taskkill /f /im KwW* >NUL 2>NUL
taskkill /f /im KwMusic* >NUL 2>NUL
taskkill /f /im KwWebKit*  >NUL 2>NUL
taskkill /f /im KwService* >NUL 2>NUL
taskkill /f /im runshelldraw* >NUL 2>NUL
taskkill /f /im WriteMbox.exe >NUL 2>NUL
taskkill /f /im KwKnowSong.exe >NUL 2>NUL

rd/s/q "%temp%\KWMUSIC" 2>NUL
del/f/s/q "%temp%\kuwo*" >NUL 2>NUL
del/f/s/q "%temp%\KwBindApp*" >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /f /v "kwmusic" >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /f /v "kwmusic" >NUL 2>NUL
reg delete "HKLM\SOFTWARE\\Microsoft\Windows\CurrentVersion\Run" /f /v "kwmusic" /reg:32 >NUL 2>NUL

ver|findstr "5\.[0-9]\.[0-9][0-9]*" >NUL && (
rd /s/q "%AllUsersProfile%\Application Data\kuwodata\kwshow" 2>NUL
rd /s/q "%AllUsersProfile%\Application Data\kuwodata\kwmusic2013\Update" 2>NUL
rd /s/q "%AllUsersProfile%\Application Data\kuwodata\kwmusic2013\ModuleData\ModNotify" 2>NUL
del/f/q "%AllUsersProfile%\Application Data\kuwodata\kwmusic2013\ModuleData\ModMusicTool\conf.txt" >NUL 2>NUL
md "%AllUsersProfile%\Application Data\kuwodata\kwmusic2013\ModuleData\ModMusicTool" 2>NUL
echo f|copy /y "Bin\Data\conf.txt" "%AllUsersProfile%\Application Data\kuwodata\kwmusic2013\ModuleData\ModMusicTool" >NUL 2>NUL
attrib +r "%AllUsersProfile%\Application Data\kuwodata\kwmusic2013\ModuleData\ModMusicTool\conf.txt" 2>NUL
echo. >"%AllUsersProfile%\Application Data\kuwodata\kwmusic2013\ModuleData\ModNotify" 2>NUL
echo. >"%AllUsersProfile%\Application Data\kuwodata\kwmusic2013\Update" 2>NUL
echo. >"%AllUsersProfile%\Application Data\kuwodata\kwshow" 2>NUL
)

ver|findstr "\<6\.[0-9]\.[0-9][0-9]*\> \<10\.[0-9]\.[0-9][0-9]*\>" >NUL && (
rd /s/q "%ProgramData%\kuwodata\kwshow" 2>NUL
rd /s/q "%ProgramData%\kuwodata\kwmusic2013\Update" 2>NUL
rd /s/q "%ProgramData%\kuwodata\kwmusic2013\ModuleData\ModNotify" 2>NUL
del/f/q "%ProgramData%\kuwodata\kwmusic2013\ModuleData\ModMusicTool\conf.txt" >NUL 2>NUL
md "%ProgramData%\Kuwodata\kwmusic2013\ModuleData\ModMusicTool" 2>NUL
echo f|copy /y "Bin\Data\conf.txt" "%ProgramData%\Kuwodata\kwmusic2013\ModuleData\ModMusicTool" >NUL 2>NUL
echo y|icacls "%ProgramData%\kuwodata\kwmusic2013\ModuleData\ModMusicTool\conf.txt" /c /grant "Everyone:(R,RX)" /inheritance:r >NUL 2>NUL
echo. >"%ProgramData%\kuwodata\kwmusic2013\ModuleData\ModNotify" 2>NUL
echo. >"%ProgramData%\kuwodata\kwmusic2013\Update" 2>NUL
echo. >"%ProgramData%\kuwodata\kwshow" 2>NUL
)

mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(a.SpecialFolders(""Desktop"") & ""\酷我音乐.lnk""):b.TargetPath=""%~sdp0KwMusic.exe"":b.WorkingDirectory=""%~sdp0"":b.Save:close")

ECHO.&ECHO 完成 &TIMEOUT /t 2 >NUL&EXIT

关联格式

bash
@ECHO OFF

cd /d "%~dp0" && ( if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs" ) && REG QUERY "HKU\S-1-5-19" 1>nul 2>nul || (  cmd /u /c echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "cmd.exe", "/k cd ""%~sdp0"" && ""%~s0"" %Apply%", "", "runas", 1 >> "%temp%\getadmin.vbs" && "%temp%\getadmin.vbs" && exit /B )

::清除残留
rd /s/q "%AppData%\2345Pic\temp"2>NUL
rd /s/q "%AppData%\2345Pic\update"2>NUL
rd /s/q "%AppData%\2345Pic\SloganPic"2>NUL
del/f/q "%AppData%\2345Pic\cloudconfig.dat" >NUL 2>NUL
del/f/q "%AppData%\2345Pic\RCOptimizeUpdate.hzc" >NUL 2>NUL
schtasks /delete /tn "Pic_2345Upgrade Task.job" /f >NUL 2>NUL
reg delete "HKLM\SYSTEM\CurrentControlSet\Services\ViewPic_2345Svc" /f >NUL 2>NUL

::注册缩列图
if exist 2345ImageThumb64.dll regsvr32 /s ".\2345ImageThumb64.dll"
::if exist 2345PicLoader.exe start "" /wait "%~dp02345PicLoader.exe" -fixdir
if exist 2345PicLoader.exe start "" /wait "%~dp02345PicLoader.exe" -install 71 -invoke-platform-x64
if exist 2345PicLoader.exe start "" /wait "%~dp02345PicLoader.exe" --rescue --invoke-point=1
if exist 2345PicLoader.exe start "" /wait "%~dp02345PicLoader.exe" -skinselected 0 -invoke-platform-x64
if exist 2345PicLoader.exe start "" /wait "%~dp02345PicLoader.exe" -check-thumbnail -invoke-platform-x64

ECHO.&ECHO 完成 &TIMEOUT /t 3 >NUL&EXIT
bash
@echo off

echo Delete HKEY_CURRENT_USER\Software\PremiumSoft\NavicatPremium\Registration[version and language]
for /f %%i in ('"REG QUERY "HKEY_CURRENT_USER\Software\PremiumSoft\NavicatPremium" /s | findstr /L Registration"') do (
    reg delete %%i /va /f
)
echo.

echo Delete Info folder under HKEY_CURRENT_USER\Software\Classes\CLSID
for /f %%i in ('"REG QUERY "HKEY_CURRENT_USER\Software\Classes\CLSID" /s | findstr /E Info"') do (
    reg delete %%i /va /f
)
echo.

echo Finish

pause

Released under the MIT License.