home *** CD-ROM | disk | FTP | other *** search
- PUSH saves the current drive, directory and environment variables (including
- PROMPT, PATH and COMSPEC) to a batch file POP.BAT. POP will restore the drive,
- directory and environment variables to the values they had when PUSH was run,
- and then delete itself. Calling POP with any parameter (eg POP dummy) will
- display the popped environment variables.
-
- The batch file POP.BAT is always placed in the same directory as PUSH.COM, as
- it is assumed (although the program doesn't require) that this directory is in
- your PATH command. Note that if you change your path after running PUSH, POP
- will restore it - but you may need to specify the drive and/or directory for
- the command processor to find POP if it is no longer on the path.
-
- PUSH's may be nested, up to 10 levels deep. Each time PUSH is run, any
- previous POP.BAT is renamed to POP.n, where n ranges from 1 to 9. Running POP
- will rename the previous POP.n (if any) to POP.BAT ready to restore the next
- level. If POP.n cannot be found, a warning message is displayed and the
- environment variable POP_ERROR is set to 1.
-
- Since PUSH saves the environment to a batch file, it uses no memory once it has
- run. Obviously, the POP files require some disk space, typically 200-300 bytes
- for the first, 600-700 bytes for subsequent files (rounded up to the next
- multiple of cluster size). Precise sizes depend on the environment.
-
- POP will restore the values of any environment variables present when PUSH was
- run, but it does not clear any variables which have been created since then. It
- also only restores the directory on the drive current when PUSH was run. Any
- changes made to directories on other drives are unaffected.
-
- PUSH works with ASSIGN'd or SUBST'd drives, provided that they are not changed
- between PUSH and POP. POP.BAT refers to the drives as they were when PUSH was
- run - if they have been changed, the results are unpredictable.
-
- If PUSH is run from a directory in PATH rather than the current one, the path
- must include the drivespec and a leading \. It's good practice to include the
- drivespec in your path anyway, since you may not always be logged to the same
- drive, but I've seen many systems that don't.
-
- PUSH returns the following exit codes:
-
- 0 - success.
- 1 - failure, but any previous POP.BAT was not lost.
- 2 - failure, and the previous POP.BAT was lost (it can usually be
- recovered by manually renaming the highest numbered POP.n).
-
- PUSH writes any error messages to STDERR, which cannot be redirected, but all
- other messages are written to STDOUT (which can be). Hence even if you run
- PUSH > NUL, (only) error messages will appear on the screen.
-
- Do not attempt to edit POP.BAT - it will contain non-printable characters, and
- does not have a CR, LF at the end of the last line. Some editors and word
- processors cannot handle this, and editing may cause the batch file to operate
- incorrectly.
-
- PUSH requires DOS version 3.30 or later.
-
- PUSH.COM is shareware, and may be copied and distributed freely. It may not be
- sold or modified. Please distribute this file with the program - don't YOU
- hate receiving software without any documentation.
-
- v1.0
- - Received as DEBUG script via FIDO's Assembly Language Echo.
- See PUSH.MSG.
-
- v1.1, Toad Hall Tweak
- - Disassembled via ASMGEN. Original PUSH.COM renamed to PUSH0.COM
- New PUSH.ASM code commented.
- - Author specified program be unchanged. Fine.
- But if you define "TOADTWEAK" when assembling PUSH, you get certain
- new benefits:
- - Smaller runtime code
- - It now works with DOS version 2.0 or later!
-
- David Kirschbaum
- Toad Hall
- kirsch@usasoc.soc.mil