Program requests are requests for batch files or executables. WindowsEnabler/MQSeries uses Windows API's to start the programs. The API's will use the standard Windows search path to look for the program. Therefore, you do not always have to specify complete paths for the programs. The command STRWINPGM CMD(NOTEPAD) will work on most PC's, since NOTEPAD.EXE is usually located in the search path. If your program is properly registered or located in the search path you only have to specify the program name, other wise you will have to specify a full-qualified path.
Please make sure that you enclose long file names that contain spaces in double quotes. To avoid possible problems you should always enclose file names in double quotes.
When you issue a program request you can use the WAIT parameter with a value *YES. It influences the moment that positive/negative action notifications are generated. If you specify *YES WindowsEnabler/MQSeries will wait until the program terminates before it returns an action notification. Otherwise WindowsEnabler will return an action notification immediately after the attempt to start the program. The action notification then indicates whether starting succeeded or not.
Please note that the use of this parameter will not always have the desired result. Some applications use a driver program that is used during start-up. This driver program starts another program and then terminates. WindowsEnabler can only wait for the termination of the driver program and not of programs started by such a driver. Microsoft Word is an example of an application that uses this technique. When you issue STRWINPGM CMD(WinWord) WAIT(*YES) you request is completed once Word is started, because at that point the driver program terminates.
PC programs always yield a numerical return value. If WindowsEnabler waits for the completion of a program it captures this return value and returns it over the reply queue so that your program can read and interpret this value. The meaning of the return value is determined by the PC program. There is a convention among PC programmers that a return value of 0 means success and any other value means failure. A program can use more than 1 value to specify different types of errors. This specification is however a convention and is not enforced. Every PC program can give a different meaning to the return value. You should consult the documentation of your PC programs for more information.