home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / WINAPP.ZIP / WINAPP.CMD < prev    next >
OS/2 REXX Batch file  |  1993-02-02  |  8KB  |  194 lines

  1. /* Program: WINAPP.CMD                                                    */
  2. /*                                                                        */
  3. /* Purpose                                                                */
  4. /*              PUBLIC APPLICATIONS - OS/2 LAN SERVER 2.0                 */
  5. /* This REXX Program allows you to do a coupe of things:                  */
  6. /* 1) Serve Public Applications with customized DOS or WIN-OS/2 settings  */
  7. /* 2) Disconnect the network drive after the user exits the application.  */
  8. /*                                                                        */
  9. /*    In large installations, you may have 30 licenses for an application */
  10. /*    and 120 people that want to use it occasionally.                    */
  11. /*    Setting Maximum number of users for the alias to 30, the first 30   */
  12. /*    users who access the application will tie up the licenses until     */
  13. /*    they log off the LAN.                                               */
  14. /*    This method solves that problem by dynamically connecting           */
  15. /*    to the network drive when the user picks the Public Application     */
  16. /*    and then disconnecting the drive when they exit the application,    */
  17. /*    thus freeing up the license count as soon as they are done          */
  18. /*                                                                        */
  19. /* Assumptions: The following programs must be under the network alias    */
  20. /*              directory:                                                */
  21. /*                         SLEEPER.EXE                                    */
  22. /*                         WINAPP2.CMD                                    */
  23. /*                                                                        */
  24. /*            * The argument NetDrive is passed to this command procedure */
  25. /*              specifying the network drive letter you wish to use.      */
  26. /*              For Example:  WINAPP.CMD S:                               */
  27. /*              On the COMMAND LINE field in OS/2 Lan Server              */
  28. /*            * Set up the application as a Public OS/2 Application       */
  29. /*              in Lan Server.                                            */
  30. /*                                                                        */
  31. /* Revision History:                                                      */
  32. /*      Date            Analyst       Version   Comments                  */
  33. /*      --------        -------       -------   --------------            */
  34. /*      12/08/92        D. Campbell     1.0     Original                  */
  35. /*                                                                        */
  36. /*                                                                        */
  37. /*                                                                        */
  38. /* */
  39. /* Load REXX utility functions */
  40. call rxfuncadd sysloadfuncs, rexxutil, sysloadfuncs
  41. call sysloadfuncs
  42.  
  43. arg NetDrive
  44.  
  45. '@ECHO OFF'
  46. Say 'Running Excel 4.0...'
  47.  
  48. /* substitute the name of your file alias were WINXL40 is below */
  49. 'NET USE' NetDrive 'WINXL40 > NUL'
  50. if rc \= 0 then SIGNAL Error
  51.  
  52. /* See if the application data directory exists on the requester */
  53. rc = SysFileTree('C:\EXCEL',file_list,'D')
  54. If file_list.0 = 0 Then
  55.  Do
  56.    'C:'
  57.    Call SysMkDir 'C:\EXCEL'
  58.  End
  59.  
  60. /* Run Excel 4.0 */
  61.  
  62. /* Log to the network drive that contains the application */
  63. NetDrive
  64.  
  65. /* Define elements of the program object */
  66. /* Refer to Mike Lamb's CRTOBJ.TXT for full description of all these */
  67. /* settings */
  68. classname='WPProgram'
  69. title='Excel 4.0'
  70. location='<WP_NOWHERE>'                  /* place in invisible folder  */
  71. program='EXENAME='NetDrive'\EXCEL.EXE;PARAMETERS=-P C:\EXCEL;'
  72. type='PROGTYPE=WIN;MAXIMIZED=YES;'       /* type of session (WIN-OS/2) */
  73. startup='STARTUPDIR='NetDrive';'         /* startup directory          */
  74. settings='SET DPMI_MEMORY_LIMIT=4;'      /* required DOS settings      */
  75. open='OPEN=DEFAULT;'                     /* open now                   */
  76.  
  77. call SysCreateObject classname, title, location,,
  78.     program||type||startup||settings||open, 'REPLACE'
  79.  
  80.  
  81. /* If SLEEPER.EXE and WINAPP2.CMD do not exist on the users */
  82. /* workstation, copy them */
  83. rc = SysFileTree('c:\os2\system\sleeper.exe',file_list,'B')
  84. If file_list.0 = 0 Then
  85.   Do
  86.     'copy 'NetDrive'\sleeper.exe c:\os2\system'
  87.   End
  88.  
  89. rc = SysFileTree('c:\os2\system\winapp2.cmd',file_list,'B')
  90. If file_list.0 = 0 Then
  91.   Do
  92.     'copy 'NetDrive'\winapp2.cmd c:\os2\system'
  93.   End
  94.  
  95. /* Detach a process that tries to delete the network connection every   */
  96. /* 25 seconds. It will fail as long as the application is being used.   */
  97. /* Once the user exits the app, the drive will be deleted successfully  */
  98. /* This idea was compilments of Tom Myers - IBM                         */
  99. 'detach c:\os2\system\winapp2.cmd 'NetDrive
  100. Exit
  101.  
  102. Error:
  103.   Say ' '
  104.   Say "Couldn't access Excel 4.0 on the server!"
  105.   'PAUSE'
  106.   Exit
  107.  
  108.  
  109. /* The text below is from Mike Lamb's CRTOBJ.TXT */
  110.  
  111. **********************************
  112. ***WPProgram setup string parms***
  113. **********************************
  114. KEYNAME      VALUE           Description
  115. -----------------------------------------------------------------------------
  116. <<Program>>
  117. EXENAME      filename        Sets the name of the program
  118. PARAMETERS   params          Sets the parameters list, which may
  119.                              include substitution characters
  120. STARTUPDIR   pathname        Sets the working directory
  121. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  122. <<Sessions>>
  123. PROGTYPE     FULLSCREEN      Sets the session type to OS/2 full screen
  124.              PM              Sets the session type to PM
  125.              SEPARATEWIN     Sets the session type to WIN-OS2 window
  126.                              running in a separate VDM.
  127.              VDM             Sets the session type to DOS full screen
  128.              WIN             Sets the session type to WIN-OS2 full screen
  129.              WINDOWABLEVIO   Sets the session type to OS/2 windowed
  130.              WINDOWEDVDM     Sets the session type to DOS windowed
  131.              WINDOWEDWIN     Sets the session type to WIN-OS2 windowed
  132. MINIMIZED    YES             Start program minimized
  133. MAXIMIZED    YES             Start program maximized
  134. NOAUTOCLOSE  YES             Leaves the window open upon program termination.
  135.              NO              Closes the window when the program terminates.
  136. -DOS Settings-
  137. NOTES:
  138. - To change these values you use SET keyname=
  139.   Example:   SET DOS_FILES=45;SET DOS_HIGH=1
  140.   Also for some use values of 1 for ON, 0 for off
  141.   Example:   SET COM_HOLD=1;     (on, default is off)
  142.   To add more than one DOS_DEVICE you need to separate with hex 0A (line-feed)
  143.   Rexx example:
  144.   h0A='0A'X
  145.   setup='...;SET DOS_DEVICE=C:\OS2\MDOS\ANSI.SYS'h0A'C:\OS2\MDOS\EGA.SYS...'
  146.  
  147. List of DOS Setting fields
  148. COM_HOLD
  149. DOS_BACKGROUND_EXECUTION
  150. DOS_BREAK
  151. DOS_DEVICE
  152. DOS_FCBS
  153. DOS_FCBS_KEEP
  154. DOS_FILES
  155. DOS_HIGH
  156. DOS_LASTDRIVE
  157. DOS_RMSIZE
  158. DOS_SHELL
  159. DOS_STARTUP_DRIVE
  160. DOS_UMB
  161. DOS_VERSION
  162. DPMI_DOS_API
  163. DPMI_MEMORY_LIMIT
  164. DPMI_NETWORK_BUFF_SIZE
  165. DPMI_DOS_API
  166. EMS_FRAME_LOCATION
  167. EMS_HIGH_OS_MAP_REGION
  168. EMS_LOW_OS_MAP_REGION
  169. EMS_MEMORY_LIMIT
  170. HW_NOSOUND
  171. HW_ROM_TO_RAM
  172. HW_TIMER
  173. IDLE_SECONDS
  174. IDLE_SENSITIVITY
  175. KBD_ALTHOME_BYPASS
  176. KBD_BUFFER_EXTEND
  177. KBD_RATE_LOCK
  178. MEM_INCLUDE_REGIONS
  179. MEM_EXCLUDE_REGIONS
  180. MOUSE_EXCLUSIVE_ACCESS
  181. PRINT_TIMEOUT
  182. VIDEO_FASTPASTE
  183. VIDEO_MODE_RESTRICTION
  184. VIDEO_ONDEMAND_MEMORY
  185. VIDEO_RETRACE_EMULATION
  186. VIDEO_ROM_EMULATION
  187. VIDEO_SWITCH_NOTIFICATION
  188. VIDEO_WINDOW_REFRESH
  189. VIDEO_8514A_XGA_IOTRAP
  190. XMS_HANDLES
  191. XMS_MEMORY_LIMIT
  192. XMS_MINIMUM_HMA
  193.  
  194.