[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[系统相关] 批处理怎么判断系统是win11,网上找了很多也不管用

  1. REM ;  判断系统
  2. ver | find "4.0" > nul && set TheOS=Windows 95 && goto exit
  3. ver | find "4.10"> nul && set TheOS=Windows 98 && goto exit
  4. ver | find "4.90"> nul && set TheOS=Windows me && goto exit
  5. ver | find "3.51"> nul && set TheOS=Windows NT35 && goto exit
  6. ver | find "5.0" > nul && set TheOS=Windows 2000 && goto exit
  7. ver | find "5.1" > nul && set TheOS=Windows XP && goto exit
  8. ver | find "5.2" > nul && set TheOS=Windows 2003 && goto exit
  9. ver | find "6.0" > nul && set TheOS=Windows Vista && goto exit
  10. ver | find "6.1" > nul && set TheOS=Windows 7 && goto Win7
  11. ver | find "6.2" > nul && set TheOS=Windows 8 && goto exit
  12. ver | find "6.3" > nul && set TheOS=Windows 8.1 && goto exit
  13. ver | find "10.0"> nul && set TheOS=Windows 10 && goto Win10
  14. :Win7
  15. if /i "%PROCESSOR_ARCHITECTURE%" equ "amd64" (
  16. set OsProcessor="X64位"
  17. ) else (
  18. if /i "PROCESSOR_ARCHITECTURE" equ "x86" (
  19. set OsProcessor="X86位"
  20. ) else (
  21. set OsProcessor="未知"
  22. )
  23. )
  24. if %OsProcessor%=="X64位" goto W7x64
  25. if %OsProcessor%=="X86位"  goto W7x86
  26. if %OsProcessor%=="未知" exit
  27. :W7x64
  28. REM ;  关闭Windows外壳程序explorer
  29. taskkill /f /im explorer.exe
复制代码

win11也是10.0几.很郁闷

TOP

本帖最后由 Five66 于 2024-5-27 11:04 编辑

大于等于22000,不行就弄成列表
https://learn.microsoft.com/zh-c ... release-information

TOP

  1. systeminfo | find "OS"
复制代码

TOP

Windows 11              版本 10.0.22000.194- 开始
Windows 10              版本 10.0.10240 开始,以内部版本10.0.19044 结束。
所以改成
ver | find "10.0.1"> nul && set TheOS=Windows 10
ver | find "10.0.2"> nul && set TheOS=Windows 11
测试win11成功

TOP

返回列表