home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / mpm1_28.zip / adopt.cmd next >
OS/2 REXX Batch file  |  1995-10-05  |  2KB  |  40 lines

  1. /****************************************************************************/
  2. /*                                                                          */
  3. /* Adopts files in specific areas                                           */
  4. /*                                                                          */
  5. /* Some preliminary notes:                                                  */
  6. /*                                                                          */
  7. /* Auto Adopt on main page 3 should be turned off. If you have it on this   */
  8. /* script isn't needed. This script is only for those folks who only want   */
  9. /* to adopt files in specific areas.                                        */
  10. /*                                                                          */
  11. /****************************************************************************/
  12. '@echo off'
  13.  
  14. /* AdoptAreas should be a string containing the area tags of the areas you  */
  15. /* want to adopt files in. Each area tag should be separated by a space.    */
  16.  
  17. AdoptAreas = '0 17 BBS'
  18.  
  19.  
  20. /* LeaveOpen is a flag, if set to 1 the FILES.BBS windows are left open and */
  21. /* the FILES.BBS is *not* saved. If set to 0, the FILES.BBS is saved and    */
  22. /* the window is closed. The default is to leave them open.                 */
  23.  
  24. LeaveOpen = 1
  25.  
  26.  
  27. Do i = 1 To Words(AdoptAreas)
  28.     area = Word(AdoptAreas, i)
  29.     retVal = MPM_OpenArea(area)
  30.     If retVal = 'OK' Then Do
  31.         retVal = MPM_AdoptFiles(area)
  32.         If retVal <> 'ERROR' & LeaveOpen = 0 Then Do
  33.             Call MPM_SaveFilesBBS area
  34.             Call MPM_CloseArea area
  35.         End
  36.     End
  37. End
  38.  
  39. Exit 0
  40.