home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 6 File / 06-File.zip / flist58.zip / FSAVENV.CMD < prev    next >
OS/2 REXX Batch file  |  1990-02-26  |  780b  |  30 lines

  1. @echo off
  2. rem This is an example of a CMD file that can be run within FLIST to save
  3. rem the environment to a CMD file.
  4. rem
  5. rem We save the environment by redirecting the output of the GENV program
  6. rem to a file. If GENV detects that its output has been redirected it 
  7. rem writes 'SET' commands which can later be used to restore the environment.
  8. rem
  9. if .%1 == . goto Usage
  10. if .%2 == . goto Doit
  11. :Usage
  12. echo Usage is:
  13. echo          %0 filename
  14. echo Where filename is the name of the file to write the SET commands to.
  15. mline
  16. goto End
  17. :Doit
  18. if exist %1 goto Prompt
  19. goto Newfile
  20. :Prompt
  21. MLINE "File %1 already exists - Action?" Overwrite Append Exit
  22. if errorlevel 2 goto End
  23. if errorlevel 1 goto Append
  24. :Newfile
  25. GENV > %1
  26. goto End
  27. :Append
  28. GENV >> %1
  29. :End
  30.