home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / os2 / os2exec.zip / OS2EXEC.DOC < prev    next >
Text File  |  1993-01-05  |  4KB  |  125 lines

  1. ===============================================================================
  2. os2exec.doc   EXECUTING OS/2 PROGRAMS FROM DOS SESSION              05-Jan-1993
  3. ===============================================================================
  4.                                      Copyright (c) 1992-1993 by Eberhard Mattes
  5.  
  6. Enclosed you'll find the following files:
  7.  
  8. os2exec.doc     This file
  9. os2exec.c       Source for os2exec.exe
  10. os2exec.exe     DOS program to execute OS/2 programs
  11. os2execd.c      Source for os2execd.exe
  12. os2execd.exe    OS/2 program which receives requests from DOS programs
  13. makefile        Makefile for compiling the two programs
  14.  
  15.  
  16. os2exec and os2execd are copyright (c) 1992-1993 by Eberhard Mattes.
  17. All rights are reserved.  Copying of these files is authorized only if
  18. (1) you are Eberhard Mattes, or if
  19. (2) you make absolutely no changes to your copy, or
  20. (3) you rename os2execd and os2exec and change the name of the named
  21.     pipe to something different from \pipe\os2exec.em
  22.  
  23. These restrictions are required to ensure that existing applications
  24. continue to work if you change os2execd.
  25.  
  26.  
  27. Usage:
  28.  
  29. Run
  30.  
  31.   os2execd
  32.  
  33. in a OS/2 session.  The following command line options are available:
  34.  
  35.   -s  switch windows (make the os2execd session active when executing
  36.       a command, switch back after executing the command)
  37.  
  38.   -v  verbose mode (display information for debugging)
  39.  
  40.  
  41. Type
  42.  
  43.   os2exec <command>
  44.  
  45. in a DOS session to let os2execd execute the OS/2 command <command> by
  46. invoking CMD.EXE.  All environment variables with the exception of
  47. COMSPEC, PROMPT and PATH are passed to the OS/2 session.  If you
  48. precede <command> with -x, CMD.EXE is not called and the program is
  49. executed directly instead.
  50.  
  51. Type
  52.  
  53.   os2exec -q
  54.  
  55. in a DOS session to make os2execd quit.
  56.  
  57.  
  58. If one os2execd is running, only one DOS program at a time can connect
  59. to os2execd.  To allow for more DOS programs connecting to os2execd,
  60. run multiple instances of os2execd.
  61.  
  62.  
  63. If you want to write a DOS program which uses os2execd, here's what
  64. you have to do:
  65.  
  66.   - open a file named \pipe\os2exec.em in read/write mode
  67.  
  68.   - send messages
  69.  
  70.   - wait for response
  71.  
  72.   - close the file
  73.  
  74. Messages start with two bytes indicating the length of the message.
  75. These two bytes are not included in the length.  The low-order byte of
  76. the length is sent first.
  77.  
  78. The third byte of a message is a command character.  The following
  79. commands are available:
  80.  
  81.   A  Acknowledge for return code
  82.  
  83.   Q  Stop os2execd.  You should wait for acknowledge before closing
  84.      the file
  85.  
  86.   C  Execute command by CMD.EXE: command
  87.  
  88.   E  Send environment variable: name=value
  89.  
  90.   X  Execute command directly: command
  91.  
  92.   W  Set working directory: directory or d:directory
  93.  
  94. Starting at the forth byte the argument (see list above, the command
  95. is shown after the colon) should be sent.
  96.  
  97. os2execd sends back a response for the C and X commands using the same
  98. length/command/arguments format.  The following command bytes are
  99. defined:
  100.  
  101.   A  Acknowledge for Q command
  102.  
  103.   R  Program executed: return code (or -1 if failed)
  104.  
  105.  
  106. NO WARRANTY: No guarantee is made as to the proper functioning of the
  107. software.  No liability will be admitted for damage resulting from
  108. using the software.
  109.  
  110. The author of os2exec and os2execd is:
  111.  
  112.   Eberhard Mattes
  113.   Teckstraße 81
  114.   D-7141 Möglingen
  115.   Germany
  116.  
  117.   Internet: mattes@azu.informatik.uni-stuttgart.de        (subject to change)
  118.  
  119. No telephone calls please! It must be stressed that the author does
  120. not reply to letters if you don't include return postage
  121. (international postal reply coupon if you're outside Germany) and a
  122. self-addressed envelope.
  123.  
  124.                                   -- END --
  125.