简体   繁体   English

如何以编程方式确定 Windows PE 版本?

[英]How can I programmatically determine Windows PE version?

My application needs to determine whether it is running on Windows PE.我的应用程序需要确定它是否在 Windows PE 上运行。

Neither the deprecated GetVersionEx function nor the preferred alternative Version Helper APIs offer any indication whether I am operating on WinPE, only indicating the version of the OS.已弃用的GetVersionEx function 和首选的替代版本助手 API都没有提供任何指示我是否在 WinPE 上运行,仅指示操作系统的版本。

This reference lists the compatible APIs for WinPE, so I need to be able limit my app to those APIs. 此参考列出了适用于 WinPE 的兼容 API,因此我需要能够将我的应用程序限制为这些 API。

How can I programmatically determine from my App whether I am on WinPE, and which PE version is running?如何以编程方式从我的应用程序中确定我是否在 WinPE 上,以及正在运行哪个 PE 版本?

If you simply need to determine whether you are running WinPE or not, you can check for the presence of the key MiniNT in HKLM\System\CurrentControlSet\Control or HKLM\System\ControlSet001\Control .如果您只是需要确定您是否正在运行 WinPE,您可以检查HKLM\System\CurrentControlSet\ControlHKLM\System\ControlSet001\Control中是否存在密钥MiniNT If it is present, you are on WinPE 2.x or higher.如果存在,则您使用的是 WinPE 2.x 或更高版本。

Cited in MSDN docs here , you can see which version of Windows PE youare running at the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinPE .此处的 MSDN 文档中引用,您可以在注册表项HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinPE中查看您正在运行的 Windows PE 版本。 That reference also gives a table of features and functionality each version will provide you.该参考还提供了每个版本将为您提供的特性和功能表。

For very old versions of Windows/WinPE before 2.0, check the version of %SYSTEMROOT%\SYSTEM32\FACTORY.EXE .对于 2.0 之前的非常旧的 Windows/WinPE 版本,请检查%SYSTEMROOT%\SYSTEM32\FACTORY.EXE的版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在“版本”选项卡中显示的Windows PE文件中获取信息? - How can I get the information inside a Windows PE file that is displayed in the Version Tab? 如何从VB 6应用程序中确定Windows版本? - How can I determine the Windows version from a VB 6 app? 如何以编程方式判断Windows PE文件是控制台子系统还是Windows子系统? - How to tell if a windows PE file is a console subsystem or a windows subsystem programmatically? 如何以编程方式确定(Windows)操作系统的最大用户模式空间? - How can I programmatically determine the maximum user-mode space of the (windows) OS? 如何使用批处理来确定计算机正在运行的 Windows 版本? - How can I use batch to determine what version of windows a computer is runing? 如何确定可移动驱动器上安装的Windows版本 - How do I determine the Windows version installed on a removable drive 如何以编程方式确定是否已安装VS2012 Update 1? - How can I programmatically determine if VS2012 Update 1 is installed? 如何将Active Directory支持添加到Windows PE? - How do I add Active Directory support to Windows PE? 如何以编程方式刷新Windows资源管理器? - How can I programmatically refresh Windows Explorer? 如何以编程方式确定Windows可执行文件DLL依赖项? - How to determine a windows executables DLL dependencies programmatically?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM