I have a C++ executable (built for x64) that is a command line program to capture some information about the machine it is running on. I am trying to run it in a WinPE environment for the first time, the exe completes almost instantaneously without generating any text on the console or writing to a log file it is supposed to create.
This is what I did:
- Followed instructions here to created a bootable WinPE USB flashdrive
- Followed instructions here to add custom binaries, including the exe, to the image
- Booted a machine into WinPE using the flash drive and executed my exe
The program runs fine on regular Windows, so I know there's nothing obviously wrong with it. I am wondering if there is something peculiar to WinPE or if I could be overlooking something else.
I recently had the same issue and was able to figure out the problem. The issue is there are some dependencies in the binaries that are not available in WinPE image.
I use this tool to view the dependencies of the binaries and check the availability of the dependencies in WinPE image (windows\system32<dependency>).
The program should run by copying the missing DLL into WinPE, or editing the build config to remove the dependencies from the binary.