From MSDN

GetBinaryType

The GetBinaryType function determines whether a file is executable, and if so, what type of executable file it is. That last property determines which subsystem an executable file runs under

BOOL GetBinaryType(
LPCTSTR lpApplicationName,
LPDWORD lpBinaryType
);

Wouldnt this be exactly what you want the $run identifier to do?


Have Fun smile