Hooray!!! So I was able to resolve this relatively quickly thanks to the almighty Google and some help from a colleague. The way I was able to resolve this was by compiling some source code readily available on the interwebs. The sourcecode is only a few short lines and the result after compiling are small executables that run natively in WinPE without any additional dependencies. I compiled both 32-Bit and 64-Bit executables and they were only about 100kb each. I am now able to use these executables in both 32-Bit and 64-Bit WinPE environments to accurately determine what bootmode the systems are running in.
The sourcecode is available here:
https://gitlab.com/xcat/xcat-core/blob/32ff6338de3a746177fd7c18a76cf9057454e1e0/xCAT-server/share/xcat/netboot/windows/detectefi.cpp
I then downloaded the free version of Visual Studio (Community Edition) and installed all of the available components for C++
Visual Studio Community (Free) is available here:
https://www.visualstudio.com/downloads/
I then used the comandline versions of the compiler to compile 32 and 64 bit versions of the application as shown below:
- (Right Click Run as Administrator) on one of the following Tools or Both if you need both architectures like I did.
VS2015 x86 Native Tools Command Prompt
VS2015 x64 Native Tools Command Prompt
- Path to location of .cpp file
- Type the following command:
cl efidetect.cpp
Thats it, now I can detect what bootmode the system is runnning in by executing one of the executables while in WinPE. Hope this helps others.
If you are unable to compile them or need assistance, please PM me and I would be happy to help you accomplish the same.
Thanks guys :)