简体   繁体   中英

How can I programmatically determine Windows PE version?

My application needs to determine whether it is running on 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.

This reference lists the compatible APIs for WinPE, so I need to be able limit my app to those APIs.

How can I programmatically determine from my App whether I am on WinPE, and which PE version is running?

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 . If it is present, you are on WinPE 2.x or higher.

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 . 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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM