home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: InfoMgt / InfoMgt.zip / omnidemo.zip / GMBATCH.CMD < prev    next >
OS/2 REXX Batch file  |  1997-07-01  |  2KB  |  72 lines

  1. /* REXX PROGRAM */
  2. /* Batch file to move import/export profiles into proper Goldmine directory */
  3.  
  4. "@echo off"
  5.  
  6. destpath = ""
  7. call RxFuncAdd 'SysMkDir', 'RexxUtil', 'SysMkDir'
  8. DO FOREVER
  9.     IF destpath = "" THEN DO
  10.         SAY "Enter the full directory path (including drive) where GoldMine"
  11.         SAY "is installed.  If you press Enter without typing anything"
  12.         SAY "the directory c:\goldmine is assumed."
  13.         SAY "If you would like to abort this batch file, type QUIT and press Enter."
  14.         PULL destpath
  15.         IF destpath = "QUIT" THEN EXIT
  16.         END
  17.     IF destpath = "" THEN destpath = "C:\GOLDMINE"
  18.     /* we will put original import/export files in a subdirectory called IMP */
  19.     fulldestpath = destpath||"\IMPEXP"
  20.     rc = SysMkDir(fulldestpath)
  21.     if rc == 0 THEN LEAVE
  22.     SAY ""
  23.     if rc == 3 THEN say "The path " destpath " was not found."
  24.     ELSE if rc == 5 THEN DO
  25.         say "Warning: it appears the import/export files have already been copied."
  26.         say "           If they are copied again, you may lose your original"
  27.         say "           import/export profiles."
  28.         say "    Press return to continue; type QUIT to exit"
  29.         PULL response
  30.         IF response = "" THEN LEAVE
  31.         ELSE EXIT
  32.         END
  33.     ELSE say "Error creating the directory: " fulldestpath
  34.         SAY "Enter a new path."
  35.         SAY ""
  36.         destpath = ""
  37.         END
  38.  
  39. version=""
  40. DO FOREVER
  41.     IF version = "" THEN DO
  42.         SAY "What version of Goldmine are you using?"
  43.         SAY "     Respond 'WIN' if you are using Goldmine for Windows"
  44.         SAY "     Respond '95' if you are using Goldmine for Windows 95"
  45.         SAY "If you would like to abort this batch file, type QUIT and press Enter."
  46.         PULL version
  47.         IF version = "QUIT" THEN EXIT
  48.         END
  49.     IF version = "WIN" | version = "95" THEN LEAVE
  50.     SAY ""
  51.     SAY "ERROR: Invalid Goldmine version"
  52.     SAY ""
  53.     version = ""
  54.     END
  55.  
  56. /* Copy the files */
  57. SAY ""
  58. SAY "Now copying files..."
  59. IF version = "WIN" THEN DO
  60.     "copy " impex2wn.ntx fulldestpath"\impexp2.ntx"
  61.     "copy " impexpwn.gbf fulldestpath"\impexp.dbf"
  62.     "copy " impexpwn.gbt fulldestpath"\impexp.dbt"
  63.     "copy " impexpwn.ntx fulldestpath"\impexp.ntx"
  64.     END
  65. ELSE DO
  66.     "copy " impex295.ntx fulldestpath"\impexp2.ntx"
  67.     "copy " impexp95.gbf fulldestpath"\impexp.dbf"
  68.     "copy " impexp95.gbt fulldestpath"\impexp.dbt"
  69.     "copy " impexp95.ntx fulldestpath"\impexp.ntx"
  70.     END
  71.  
  72.