Frequently Asked Questions
Executing a program from my application
Question:
How do I execute a program from my application?
Answer:
Using the WinExec function is the easiest way to execute an
program from your application.
To execute a standard program, simply use:
WinExec('C:\WINDOWS\NOTEPAD.EXE', SW_SHOWNORMAL);
To add a command line, use:
WinExec('C:\WINDOWS\NOTEPAD.EXE C:\WINDOWS\WIN.INI', SW_SHOWNORMAL);
To pop up a DOS box, use:
WinExec('COMMAND.COM', SW_SHOWNORMAL);
To execute a DOS command, use:
WinExec('COMMAND.COM /C DIR *.*', SW_SHOWNORMAL);