加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

如何检测Windows 2012核心版(C)

发布时间:2020-12-14 05:37:00 所属栏目:Windows 来源:网络整理
导读:我需要在我的程序中检测 Windows 2012上的版本. 在以前的操作系统中,我使用了GetProductInfo的pdwReturnedProductType,但根据msdn: PRODUCT_*_SERVER_CORE values are not returned in Windows Server 2012. For example,the base server edition,Server Da
我需要在我的程序中检测 Windows 2012上的版本.
在以前的操作系统中,我使用了GetProductInfo的pdwReturnedProductType,但根据msdn:

PRODUCT_*_SERVER_CORE values are not returned in Windows Server 2012. For example,the base server
edition,Server Datacenter,is used to build the two different installation options: “full server”
and “core server”. With Windows Server 2012,GetProductInfo will return PRODUCT_DATACENTER
regardless of the option used during product installation.

有没有其他可能检测核心版本?
谢谢.

解决方法

HKLMSoftwareMicrosoftWindows NTCurrentVersionServerServerLevels
    ServerCore = 1
    Server-Gui-Mgmt = 1
    Server-Gui-Shell = 1

根据MSDN使用这些注册表值是一种方法.另一种方法是解析dism / online / get-features / format:table的输出,看看是否启用或禁用了功能ServerCore-FullServer.如果它被禁用,那么你处于servercore gui-less模式.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读