home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / ftpser07.zip / folder.cmd < prev    next >
OS/2 REXX Batch file  |  1998-08-10  |  4KB  |  159 lines

  1. /* REXX Script to create FtpServer folder on desktop. */
  2. /*     Thanks to Garey Smiley for providing this.     */
  3.  
  4. /* Register with REXX API extensions. */
  5. Call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  6. Call SysLoadFuncs
  7.  
  8. /* Get creation disposition. */
  9. Call SysCls
  10. Say
  11. Say 'Create FTPServer folder and icons.'
  12. Say
  13. Say 'NOTE: This program needs to be executed from the directory'
  14. Say '      FTPServer is installed in.'
  15. Say
  16. /* '@pause' */
  17. CreateCollision = 'Update'
  18. /* CreateCollision = 'Replace' */
  19. Say
  20.  
  21. Call CreateObjects
  22. Exit
  23.  
  24.  
  25. CreateObject: procedure
  26.     Parse Arg Class, Title, Location, Setup, Collision
  27.     Say 'Creating ['Title']'
  28.     rc = SysCreateObject( Class, Title, Location, Setup, Collision )
  29.     If rc <> 1 Then
  30.         Say ' > failed to create ['Title' | 'Class'] at location ['Location']'
  31.     return rc
  32.  
  33.  
  34. FileExists: procedure
  35.     Parse Arg Filename
  36.     Call SysFileTree Filename, filelist, 'F'
  37.     IF filelist.0 = 1 THEN
  38.         rc = 1
  39.     ELSE
  40.         rc = 0
  41.     RETURN rc
  42.  
  43. /*
  44.  * Another way to do FileExists
  45.  *
  46. FileExists:
  47.     return( stream( arg(1), 'c', 'query exists' ) <> '' )
  48. */
  49.  
  50. DirectoryExists: procedure
  51.     Parse Arg Dirname
  52.     Call SysFileTree Dirname, dirlist, 'D'
  53.     IF dirlist.0 = 1 THEN
  54.         rc = 1
  55.     ELSE
  56.         rc = 0
  57. RETURN rc
  58.  
  59.  
  60. CreateObjects:
  61.  
  62. current_dir = directory()
  63. foldername = 'FtpServer'
  64. folderid = '<FTPServer_0>'
  65.  
  66. rc = CreateObject( 'WPFolder',,
  67.     foldername,,
  68.     '<WP_DESKTOP>',,
  69.     'ALWAYSSORT=YES;'||,
  70.         'SHOWALLINTREEVIEW=YES;'||,
  71.         'OBJECTID='||folderid,,
  72.     CreateCollision )
  73.  
  74.   rc = CreateObject( 'WPShadow',,
  75.       'changes.doc',,
  76.       folderid,,
  77.       'SHADOWID='||current_dir||'\doc\changes.doc',,
  78.       CreateCollision )
  79.  
  80.   rc = CreateObject( 'WPProgram',,
  81.       'Setup',,
  82.       folderid,,
  83.       'NOPRINT=YES;'||,
  84.           'DEFAULTVIEW=RUNNING;'||,
  85.           'EXENAME='||current_dir||'\SETUP.EXE;'||,
  86.           'STARTUPDIR='||current_dir||';'||,
  87.           'PROGTYPE=WINDOWABLEVIO',,
  88.       CreateCollision )
  89.  
  90.   rc = CreateObject( 'WPShadow',,
  91.       'purchase.doc',,
  92.       folderid,,
  93.       'SHADOWID='||current_dir||'\BMTMicro\purchase.doc',,
  94.       CreateCollision )
  95.  
  96.   rc = CreateObject( 'WPShadow',,
  97.       'purchase.exe',,
  98.       folderid,,
  99.       'SHADOWID='||current_dir||'\BMTMicro\purchase.exe',,
  100.       CreateCollision )
  101.  
  102.   rc = CreateObject( 'WPProgram',,
  103.       'FTPD',,
  104.       folderid,,
  105.       'NOPRINT=YES;'||,
  106.           'MINWIN=VIEWER;'||,
  107.           'DEFAULTVIEW=RUNNING;'||,
  108.           'EXENAME='||current_dir||'\FTPD.EXE;'||,
  109.           'STARTUPDIR='||current_dir||';'||,
  110.           'PROGTYPE=WINDOWABLEVIO;'||,
  111.           'MINIMIZED=YES',,
  112.       CreateCollision )
  113.  
  114.   rc = CreateObject( 'WPShadow',,
  115.       'readme',,
  116.       folderid,,
  117.       'SHADOWID='||current_dir||'\readme',,
  118.       CreateCollision )
  119.  
  120.   rc = CreateObject( 'WPProgram',,
  121.       'FtpServer^Documentation',,
  122.       folderid,,
  123.       'NOPRINT=YES;'||,
  124.           'DEFAULTVIEW=RUNNING;'||,
  125.           'EXENAME=view.exe;'||,
  126.           'STARTUPDIR='||current_dir||';'||,
  127.           'PARAMETERS=ftpserver.INF;'||,
  128.           'PROGTYPE=PM',,
  129.       CreateCollision )
  130.  
  131.   rc = CreateObject( 'WPProgram',,
  132.       'Monitor',,
  133.       folderid,,
  134.       'NOPRINT=YES;'||,
  135.           'DEFAULTVIEW=RUNNING;'||,
  136.           'EXENAME='||current_dir||'\MONITOR.EXE;'||,
  137.           'STARTUPDIR='||current_dir||';'||,
  138.           'PROGTYPE=WINDOWABLEVIO',,
  139.       CreateCollision )
  140.  
  141.   if FileExists(current_dir||'\FTPUSERS.LOG') THEN DO
  142.     rc = CreateObject( 'WPShadow',,
  143.         'FTPUSERS.LOG',,
  144.         folderid,,
  145.         'SHADOWID='||current_dir||'\FTPUSERS.LOG',,
  146.         CreateCollision )
  147.   END
  148.  
  149.   if FileExists(current_dir||'\FTPTRANS.LOG') THEN DO
  150.     rc = CreateObject( 'WPShadow',,
  151.         'FTPTRANS.LOG',,
  152.         folderid,,
  153.         'SHADOWID='||current_dir||'\FTPTRANS.LOG',,
  154.         CreateCollision )
  155.   END
  156.  
  157. return
  158.  
  159.