home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / UTILITY / ARCHIVE / PALRUN2B.ZIP / PALWP.BAT < prev    next >
Encoding:
DOS Batch File  |  1990-08-20  |  4.2 KB  |  103 lines

  1. Echo off
  2. Echo  This is a sample batch file which illustrates how you can create
  3. Echo  a detailed batch file for use with PALRUN.  This is only an
  4. Echo  example and may not work with your system unless you change
  5. Echo  applicable subdirectories, file names and extensions, etc.
  6. Echo  ∙
  7. Echo  This batch file assumes that your Palhouse is "PALHOUSE.ZIP" and
  8. Echo  that you have the appropriate extraction program available.
  9. Echo  ∙
  10. Echo  By issuing the command of "PALRUN PALWP filename", PALRUN will
  11. Echo  look for PALHOUSE.ZIP in your path and extract PALWP.BAT from that
  12. Echo  ZIP archive.  Obviously, you first have to create PALHOUSE.ZIP
  13. Echo  and store a copy of PALWP.BAT there.  In this particular example,
  14. Echo  all WordPerfect support files are housed in E:\WP\WPSPRT.ZIP, and
  15. Echo  they are extracted with one of the commands within PALWP.BAT.
  16. Echo  Similarly, all files for editing are housed within E:\WP\WPEDIT.ZIP,
  17. Echo  and the file that you request to edit (the %1 parameter) will be
  18. Echo  extracted from that ZIP archive.
  19. Echo  ∙
  20. pause
  21. Echo  ∙
  22. Echo  Once PALWP.BAT is extracted (you must have PKUNZIP on your
  23. Echo  path), PALRUN will invoke "PALWP filename".  This batch file first
  24. Echo  changes to your editing directory, then extracts all WordPerfect
  25. Echo  files from WPSPRT.ZIP, then invokes WordPerfect to edit the name
  26. Echo  of the file that you passed on the command line.
  27. Echo  ∙
  28. Echo  When you finish your editing session with WordPerfect and exit the
  29. Echo  program, control is returned to this batch file.  The last several
  30. Echo  commands in this batch file delete all of the files which were
  31. Echo  earlier extracted from WPSPRT.ZIP.
  32. Echo  ∙
  33. Echo  At the completion of the batch file, PALRUN deletes the batch file
  34. Echo  that it extracted from PALHOUSE.ZIP.
  35. Echo  ∙
  36. pause
  37. Echo  ∙
  38. Echo  *******  Batch execution begins here  *******
  39. Echo  Change to the drive and subdirectory in which the WordPerfect
  40. Echo  editing is to be done.
  41. Echo  ∙
  42. e:
  43. cd \wp
  44. Echo  ∙
  45. Echo  Extract required files into editing subdirectory, overwriting
  46. Echo  any pre-existing versions of those files.  In this case, all the
  47. Echo  support files are contained in E:\WP\WPSPRT.ZIP.
  48. Echo  ∙
  49. pkunzip -o wpsprt *.*
  50. Echo  ∙
  51. Echo  Now extract the file for editing if one has been specified on
  52. Echo  your command line and does not already exist.
  53. Echo  ∙
  54. Echo  First, skip extraction if no file was specified.
  55. Echo  ∙
  56. if  "%1"=="" goto skipextr
  57. Echo  ∙
  58. Echo  Second, if the file already exists, don't extract over it.
  59. Echo  ∙
  60. if exist %1 goto already
  61. Echo  ∙
  62. Echo  Do the extraction.
  63. Echo  ∙
  64. pkunzip -o wpedit %1
  65. goto skipextr
  66. :already
  67. Echo  %1 ALREADY EXISTS!!  SKIPPING EXTRACTION!!
  68. :skipextr
  69. Echo  ∙
  70. Echo  Call up WordPerfect.
  71. Echo  ∙
  72. wp %1
  73. Echo  ∙
  74. Echo  Now that we're through, use PKZIP to "f"reshen any of the support
  75. Echo  files that may have been changed through setup or whatever,
  76. Echo  deleting them from the disk at the same time.  With PKZIP's
  77. Echo  "-mf" switch, it is not necessary to specify the particular files
  78. Echo  that you want to freshen if you want to freshen any and all files
  79. Echo  that are already in WPSPRT.
  80. Echo  ∙
  81. Pkzip -mf wpsprt
  82. Echo  ∙
  83. Echo  And now to take care of the edited file.  We want to move it into
  84. Echo  WPEDIT.ZIP.  Since we may have created a brand new file, we want
  85. Echo  to "U"pdate rather than "F"reshen.  In this batch file we provide
  86. Echo  a skip over this command if no file was specified on the command
  87. Echo  line.  You should understand that with this batch structure, if
  88. Echo  you have summoned WordPerfect without specifying the file to
  89. Echo  edit on the command line, and if you then create or make a change
  90. Echo  to a file that's not in WPEDIT.ZIP, then it will not be
  91. Echo  automatically added to WPEDIT.ZIP when all is said and done.
  92. Echo  ∙
  93. if  "%1"=="" goto skiptidy
  94. pkzip -mu wpedit %1
  95. :skiptidy
  96. Echo  ∙
  97. Echo  Remember.  This batch file only places into WPEDIT.ZIP the file
  98. Echo  which was explicitly called when you first invoked PALRUN.  If
  99. Echo  you have edited any other file, you will have to manually add
  100. Echo  that to WPEDIT.ZIP.
  101. Echo  ∙
  102. Echo  Control is now returned to PALRUN, which deletes this batch file.
  103.