标题: [系统相关] 批处理怎么判断系统是win11,网上找了很多也不管用 [打印本页]
作者: 十三姨 时间: 2024-5-27 10:00 标题: 批处理怎么判断系统是win11,网上找了很多也不管用
- REM ; 判断系统
- ver | find "4.0" > nul && set TheOS=Windows 95 && goto exit
- ver | find "4.10"> nul && set TheOS=Windows 98 && goto exit
- ver | find "4.90"> nul && set TheOS=Windows me && goto exit
- ver | find "3.51"> nul && set TheOS=Windows NT35 && goto exit
- ver | find "5.0" > nul && set TheOS=Windows 2000 && goto exit
- ver | find "5.1" > nul && set TheOS=Windows XP && goto exit
- ver | find "5.2" > nul && set TheOS=Windows 2003 && goto exit
- ver | find "6.0" > nul && set TheOS=Windows Vista && goto exit
- ver | find "6.1" > nul && set TheOS=Windows 7 && goto Win7
- ver | find "6.2" > nul && set TheOS=Windows 8 && goto exit
- ver | find "6.3" > nul && set TheOS=Windows 8.1 && goto exit
- ver | find "10.0"> nul && set TheOS=Windows 10 && goto Win10
-
- :Win7
- if /i "%PROCESSOR_ARCHITECTURE%" equ "amd64" (
- set OsProcessor="X64位"
- ) else (
- if /i "PROCESSOR_ARCHITECTURE" equ "x86" (
- set OsProcessor="X86位"
- ) else (
- set OsProcessor="未知"
- )
- )
-
- if %OsProcessor%=="X64位" goto W7x64
- if %OsProcessor%=="X86位" goto W7x86
- if %OsProcessor%=="未知" exit
-
- :W7x64
- REM ; 关闭Windows外壳程序explorer
- taskkill /f /im explorer.exe
复制代码
作者: 十三姨 时间: 2024-5-27 10:01
win11也是10.0几.很郁闷
作者: Five66 时间: 2024-5-27 11:00
本帖最后由 Five66 于 2024-5-27 11:04 编辑
大于等于22000,不行就弄成列表
https://learn.microsoft.com/zh-c ... release-information
作者: newswan 时间: 2024-5-27 11:05
复制代码
作者: 十三姨 时间: 2024-5-27 11:05
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成功
欢迎光临 批处理之家 (http://bbs.bathome.net/) |
Powered by Discuz! 7.2 |