Sunday 26 July 2015

_popen and %ProgramFiles% On 64-Bit Windows

Quick thing!

So somewhat related to the last project, and something that's given me a headache for a very, very long time now:

When running cmd.exe macros via _popen on 64-bit Windows, the %ProgramFiles% path takes you to (for my system drive C) C:\Program Files (x86)\ however when run via the terminal itself it takes you to C:\Program Files\.

I've yet to find documentation for why this is the case, but it is. So for anyone reading, hopefully this means you don't spend several days trying to determine why your software is failing and instead realise that it's taking you to the wrong location.

Happy coding!

No comments:

Post a Comment