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

  1. /* FOLDER.CMD: Sample code using REXXUTIL's SysCreateObject function    */           
  2. /* Builds a folder on the DeskTop and places some program objects in it.*/           
  3. /* Mike Lamb: MIKELAMB/KGNVMC                                           */
  4.  
  5. /*  Modified by George Clark 71242,41  , for the purposes of creating program */
  6. /*  objects for IBM TCP/IP.  Also contains code taken from the REXX commands */
  7. /*  supplied with the TCP/IP CSD install process         */           
  8.  
  9. /* Load REXXUTIL */                                                                  
  10.  
  11. ENV = 'OS2ENVIRONMENT'                                                            
  12. ETC = VALUE('ETC',,ENV)                                                           
  13. if ETC = '' then                                                                  
  14.     do                                                                            
  15.     say ""                                                                        
  16.     say "WARNING!"                                                                
  17.     say "You do NOT have the environment variable ETC defined!"                   
  18.     say "You must have ETC set to the \TCPIP\ETC path      "
  19.     say "This process will not continue     "
  20.     say ""                                                                        
  21.     exit 1                                                                        
  22.     end                                                                           
  23.                                             
  24. BASE=filespec("drive",ETC)||filespec("path",ETC)           
  25. if substr(BASE, length(BASE), 1) = '\' then                
  26.     BASE = substr(BASE, 1, length(BASE) - 1)               
  27.            
  28. Say "Enter a name for the TCP/IP objects folder"
  29. Say "Or press enter to accept 'TCP/IP' as the folder name"
  30. pull folder
  31. if folder = '' then
  32.    folder = 'TCP/IP'
  33.  
  34. say " a folder named" folder "will be created on the desktop"
  35. say " press enter to confirm "
  36. pull OK
  37.  
  38. call rxfuncadd sysloadfuncs, rexxutil, sysloadfuncs
  39. call sysloadfuncs                                                                    
  40.  
  41. h0a='0A'x
  42.                                                                                      
  43. /*The basic call is listed next.                                           */        
  44. /*rc=SysCreateObject(classname, title, location <,setup>, <,duplicateflag>)*/        
  45.                                                                                      
  46. call SysCls                                                                          
  47. Say '';Say 'Using REXXUTILs to Add a Folder and Program Objects...'                  
  48.                                                                                      
  49.                 
  50. /* All of the routines pass parameters to a subroutine to perform the call */        
  51. classname='WPFolder'                                                                 
  52. title=folder
  53. location='<WP_DESKTOP>'                                                              
  54. setup='OBJECTID=<TCP/IP-Obj>;'||,
  55.       'OPEN=DEFAULT;'
  56. Call BldObj                                                                          
  57.                                                                                      
  58.      
  59. Say 'Press ENTER to add the program objects...'                           
  60. key=SysGetKey()                                                                      
  61.                                                                                      
  62. Say 'Place a program object into the folder...';Say '';                              
  63. classname='WPProgram'                                                                
  64. title='TCP/IP'h0a'Startup'
  65. location='<TCP/IP-Obj>'
  66. setup='OBJECTID=<TCPStartup>;'||,
  67.       'EXENAME=TCPSTART.CMD;'||,
  68.       'PROGTYPE=WINDOWABLEVIO;'
  69. Call BldObj                                                                          
  70.                                                                                      
  71. classname='WPProgram'                                                                
  72. title='SNMPD'
  73. location='<TCP/IP-Obj>'
  74. setup='OBJECTID=<SNMPD>;'||,
  75.       'EXENAME=SNMPD.EXE;'||,
  76.       'MINIMIZED=YES;'||,                                                            
  77.       'PROGTYPE=WINDOWABLEVIO;'
  78. Call BldObj                                                                          
  79.  
  80. classname='WPProgram'           
  81. title='SNMPREQD'
  82. location='<TCP/IP-Obj>'           
  83. setup='OBJECTID=<SNMPREQD>;'||,
  84.       'EXENAME=SNMPREQD.EXE;'||,
  85.       'MINIMIZED=YES;'||,       
  86.       'PROGTYPE=WINDOWABLEVIO;' 
  87. Call BldObj                     
  88.  
  89. classname='WPProgram'           
  90. title='Name Server'
  91. location='<TCP/IP-Obj>'           
  92. setup='OBJECTID=<NameServer>;'||,
  93.       'EXENAME='||BASE||'\SAMPLES\NAMED\NAMED.EXE;'||,
  94.       'MINIMIZED=YES;'||,       
  95.       'PROGTYPE=WINDOWABLEVIO;' 
  96. Call BldObj                     
  97.                                 
  98. classname='WPProgram'           
  99. title='SNMP Trap'
  100. location='<TCP/IP-Obj>'           
  101. setup='OBJECTID=<SNMPTrap>;'||,
  102.       'EXENAME=SNMPTRAP.EXE;'||,
  103.       'PROGTYPE=PM;'
  104. Call BldObj                     
  105.                                 
  106. classname='WPProgram'              
  107. title='PM Ping'
  108. location='<TCP/IP-Obj>'              
  109. setup='OBJECTID=<PMPing>;'||,
  110.       'EXENAME=PMPING.EXE;'||,
  111.       'PROGTYPE=PM;'
  112. Call BldObj                        
  113.                                    
  114.                                    
  115. classname='WPProgram'              
  116. title='FTPPM'
  117. location='<TCP/IP-Obj>'              
  118. setup='OBJECTID=<FTPPM>;'||,
  119.       'EXENAME=FTPPM.EXE;'||,
  120.       'PROGTYPE=PM;'
  121. Call BldObj                        
  122.                                                                      
  123. classname='WPProgram'              
  124. title='TCP/IP ICAT'
  125. location='<TCP/IP-Obj>'              
  126. setup='OBJECTID=<TCPICAT>;'||,
  127.       'EXENAME=ICAT.EXE;'||,
  128.       'PROGTYPE=PM;'
  129. Call BldObj                        
  130.                                    
  131.                                     
  132. classname='WPProgram'              
  133. title='TCP/IP'h0a'NSTAT'
  134. location='<TCP/IP-Obj>'              
  135. setup='OBJECTID=<TCPNSTAT>;'||,
  136.       'EXENAME='||BASE||'\SAMPLES\NSTAT\NSTAT.EXE;'||,
  137.       'ICONFILE=C:\ICONS\NETWORK.ICO;'||,
  138.       'PROGTYPE=PM;'
  139. Call BldObj 
  140.  
  141. classname='WPProgram'              
  142. title='TCP/IP'h0a'Sendmail'
  143. location='<TCP/IP-Obj>'              
  144. setup='OBJECTID=<TCPSENDMAIL>;'||,
  145.       'EXENAME=SENDMAIL.EXE;'||,
  146.       'PARAMETERS=-bd -q30m;'||,
  147.       'MINIMIZED=YES;'||,
  148.       'PROGTYPE=WINDOWABLEVIO;'
  149. Call BldObj                        
  150.   
  151. classname='WPProgram'              
  152. title='TCP/IP'h0a'LaMail'
  153. location='<TCP/IP-Obj>'              
  154. setup='OBJECTID=<LaMail>;'||,
  155.       'EXENAME=LAMAIL.EXE;'||,
  156.       'MINIMIZED=YES;'||,
  157.       'PROGTYPE=PM;'
  158. Call BldObj                        
  159.                        
  160.                                                                                          
  161. Exit                                                                                 
  162.                                                                                      
  163. /* Build Object */                                                                   
  164. BldObj:                                                                              
  165. call charout ,'Building: 'title                                                      
  166.                                                                                      
  167. /* Build object using REPLACE as duplicateflag */                                    
  168. result = SysCreateObject(classname, title, location, setup, 'R')                     
  169.                                                                                      
  170. If result=1 Then call charout ,'...   Object created!'                               
  171. Else             call charout ,'...   Not created! Return code='result               
  172.                                                                                      
  173. Say '';                                                                              
  174. Return                                                                               
  175.  
  176.