【问题标题】:get windows edition in any language获取任何语言的 Windows 版本
【发布时间】:2018-05-30 13:06:38
【问题描述】:

我正在尝试找出某些用户计算机上安装了哪个版本的 Windows。 我试过了:

wmic os get Caption /value

systeminfo | find "OS Name

winver

问题在于,对于不同的操作系统语言,我也获得了该语言的版本名称,并且我无法支持所有语言。 有没有人知道一些有用的方法来查找用户拥有的版本而不依赖于语言?

(目前我使用的命令是针对cmd的,但我是用python编写程序,所以python的解决方案也可以)

谢谢!!

【问题讨论】:

标签: python windows


【解决方案1】:

我认为你可以这样做:

>>> import platform
>>> platform.version()
'#46-Ubuntu SMP Wed May 2 13:38:30 UTC 2018'
>>> platform.machine()
'x86_64'
>>> platform.platform()
'Linux-4.13.0-41-generic-x86_64-with-Ubuntu-17.10-artful'
>>> platform.uname()
uname_result(system='Linux', node='aniruddha088', release='4.13.0-41-generic', version='#46-Ubuntu SMP Wed May 2 13:38:30 UTC 2018', machine='x86_64', processor='x86_64')
>>> platform.system()
'Linux'
>>> platform.processor()
'x86_64'

【讨论】:

  • 谢谢!我终于发现了这个:wmic os get 'OperatingSystemSKU /value',它给了我一个数字而不是文本,这解决了我的问题
  • 太棒了!我想我能帮上忙。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-02-08
  • 2011-12-29
  • 2023-04-05
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多