I have a Python program that uses os.system to execute various commands. (It cannot use subprocess because it must be backward compatible before Python 2.0.)
On Windows, sometimes the command references DLLs in an unusual directory, and therefore I get the infamous "The program does not start because X.dll is missing" error pop-up.

My question is not about how to get the team to find all its dll files. I already know how to do this. I want to know how can I tell Windows not to show this dialog when a dll is missing? Instead, the child process should print an error message in stderr (which was redirected to the file in the os.system call) and fail (by calling os.system to return the error code). That way, my program could fix the error and report it in its own way, instead of hanging until someone comes to click OK.
MSDN is usually my friend, but this time I get nothing but advice on how to deal with specific missing DLLs, which is nice and all, but not what I need this time.
Again, this is a situation with extreme backward compatibility: I need a solution that works with Python 2.7 or any old version, up to 2.0. He should also work on all popular versions of Windows (XP, Vista, 7, 8). Working with older Windows is highly desirable, but 100% is not required. In addition, third-party modules and auxiliary programs written in any other language are not an option. (I believe the .BAT file will be fine if this is the only way to do this.)
source share