当前位置:   article > 正文

批处理获取系统版本及位数_批处理判断系统版本

批处理判断系统版本

代码

  1. @echo off
  2. color 3f
  3. mode con cols=60 lines=20
  4. title 系统版本获取
  5. :: 开始获取系统版本
  6. if /i not "%os%"=="Windows_NT" (set TheOS=非Windows系统&set TheBit=) else (
  7. ver | find "4.0" > nul && set TheOS=Windows 95
  8. ver | find "4.10"> nul && set TheOS=Windows 98
  9. ver | find "4.90"> nul && set TheOS=Windows me
  10. ver | find "3.51"> nul && set TheOS=Windows NT35
  11. ver | find "5.0" > nul && set TheOS=Windows 2000
  12. ver | find "5.1" > nul && set TheOS=Windows XP
  13. ver | find "5.2" > nul && set TheOS=Windows 2003
  14. ver | find "6.0" > nul && set TheOS=Windows Vista
  15. ver | find "6.1" > nul && set TheOS=Windows 7
  16. ver | find "6.2" > nul && set TheOS=Windows 8
  17. ver | find "10.0"> nul && set TheOS=Windows 10
  18. set TheBit=x%PROCESSOR_ARCHITECTURE:~-2%
  19. )
  20. :: 完成获取
  21. echo 您的系统版本:%TheOS% %TheBit%
  22. pause
  23. exit

如果需进行判断跳转,只需在上面所需系统加上goto命令,如Win7,然后在适当的位置加上标签:win7

  1. @echo off
  2. color 3f
  3. mode con cols=60 lines=20
  4. title 系统版本获取
  5. :: 开始获取系统版本
  6. if /i not "%os%"=="Windows_NT" (set TheOS=非Windows系统&set TheBit=) else (
  7. ver | find "4.0" > nul && set TheOS=Windows 95
  8. ver | find "4.10"> nul && set TheOS=Windows 98
  9. ver | find "4.90"> nul && set TheOS=Windows me
  10. ver | find "3.51"> nul && set TheOS=Windows NT35
  11. ver | find "5.0" > nul && set TheOS=Windows 2000
  12. ver | find "5.1" > nul && set TheOS=Windows XP
  13. ver | find "5.2" > nul && set TheOS=Windows 2003
  14. ver | find "6.0" > nul && set TheOS=Windows Vista
  15. ver | find "6.1" > nul && set TheOS=Windows 7 && goto Win7
  16. ver | find "6.2" > nul && set TheOS=Windows 8
  17. ver | find "10.0"> nul && set TheOS=Windows 10
  18. set TheBit=x%PROCESSOR_ARCHITECTURE:~-2%
  19. )
  20. :: 完成获取
  21. echo 您的系统版本:%TheOS% %TheBit%
  22. pause
  23. exit
  24. :Win7
  25. echo %TheOS% %TheBit%
  26. pause
  27. exit

下载

https://download.csdn.net/download/fxziyu/9806030

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/智能墨韵书生/article/detail/61770
推荐阅读
相关标签
  

闽ICP备14008679号