home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / UTILITY / DIR / PUSH.ZIP / PUSH.DOC < prev    next >
Encoding:
Text File  |  1991-12-12  |  3.6 KB  |  76 lines

  1. PUSH saves the current drive, directory and environment variables (including
  2. PROMPT, PATH and COMSPEC) to a batch file POP.BAT.  POP will restore the drive,
  3. directory and environment variables to the values they had when PUSH was run,
  4. and then delete itself.  Calling POP with any parameter (eg POP dummy) will
  5. display the popped environment variables.
  6.  
  7. The batch file POP.BAT is always placed in the same directory as PUSH.COM, as
  8. it is assumed (although the program doesn't require) that this directory is in
  9. your PATH command.  Note that if you change your path after running PUSH, POP
  10. will restore it - but you may need to specify the drive and/or directory for
  11. the command processor to find POP if it is no longer on the path.
  12.  
  13. PUSH's may be nested, up to 10 levels deep.  Each time PUSH is run, any
  14. previous POP.BAT is renamed to POP.n, where n ranges from 1 to 9.  Running POP
  15. will rename the previous POP.n (if any) to POP.BAT ready to restore the next
  16. level.    If POP.n cannot be found, a warning message is displayed and the
  17. environment variable POP_ERROR is set to 1.
  18.  
  19. Since PUSH saves the environment to a batch file, it uses no memory once it has
  20. run.  Obviously, the POP files require some disk space, typically 200-300 bytes
  21. for the first, 600-700 bytes for subsequent files (rounded up to the next
  22. multiple of cluster size).  Precise sizes depend on the environment.
  23.  
  24. POP will restore the values of any environment variables present when PUSH was
  25. run, but it does not clear any variables which have been created since then. It
  26. also only restores the directory on the drive current when PUSH was run. Any
  27. changes made to directories on other drives are unaffected.
  28.  
  29. PUSH works with ASSIGN'd or SUBST'd drives, provided that they are not changed
  30. between PUSH and POP.  POP.BAT refers to the drives as they were when PUSH was
  31. run - if they have been changed, the results are unpredictable.
  32.  
  33. If PUSH is run from a directory in PATH rather than the current one, the path
  34. must include the drivespec and a leading \.  It's good practice to include the
  35. drivespec in your path anyway, since you may not always be logged to the same
  36. drive, but I've seen many systems that don't.
  37.  
  38. PUSH returns the following exit codes:
  39.  
  40.     0 - success.
  41.     1 - failure, but any previous POP.BAT was not lost.
  42.     2 - failure, and the previous POP.BAT was lost (it can usually be
  43.         recovered by manually renaming the highest numbered POP.n).
  44.  
  45. PUSH writes any error messages to STDERR, which cannot be redirected, but all
  46. other messages are written to STDOUT (which can be).  Hence even if you run
  47. PUSH > NUL, (only) error messages will appear on the screen.
  48.  
  49. Do not attempt to edit POP.BAT - it will contain non-printable characters, and
  50. does not have a CR, LF at the end of the last line.  Some editors and word
  51. processors cannot handle this, and editing may cause the batch file to operate
  52. incorrectly.
  53.  
  54. PUSH requires DOS version 3.30 or later.
  55.  
  56. PUSH.COM is shareware, and may be copied and distributed freely.  It may not be
  57. sold or modified.  Please distribute this file with the program - don't YOU
  58. hate receiving software without any documentation.
  59.  
  60. v1.0
  61.  - Received as DEBUG script via FIDO's Assembly Language Echo.
  62.    See PUSH.MSG.
  63.  
  64. v1.1, Toad Hall Tweak
  65.  - Disassembled via ASMGEN. Original PUSH.COM renamed to PUSH0.COM
  66.    New PUSH.ASM code commented.
  67.  - Author specified program be unchanged.  Fine.
  68.    But if you define "TOADTWEAK" when assembling PUSH, you get certain
  69.    new benefits:
  70.    - Smaller runtime code
  71.    - It now works with DOS version 2.0 or later!
  72.  
  73.    David Kirschbaum
  74.    Toad Hall
  75.    kirsch@usasoc.soc.mil
  76.