How to Run a DOS Program

Posted December 15th @ 8:42 pm by m3Rlin

You can run DOS (and Windows) programs using the Windows API WinExec() function.

WinExec(’C:\\NC.exe’, SW_NORMAL); { DOS program }

WinExec(’notepad.exe’, SW_MAXIMIZED); { Windows program started in maximized form }
For Win32 program you should use the CreateProcess() function although there will be no problems when you use this one.

How do I Execute a Program And Wait Until it is Done

Posted December 15th @ 7:36 am by m3Rlin

You may have noticed that when many compression programs execute a file they wait until it is done to clean up the temporary files made. This can be done in both Windows 3.1x and, of course in Windows 32 bit. Here’s the code for Windows 16 bit:

uses
Wintypes, WinProcs, Toolhelp, Classes, Forms;

function [...]