home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 6 File
/
06-File.zip
/
flist58.zip
/
FSAVENV.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1990-02-26
|
780b
|
30 lines
@echo off
rem This is an example of a CMD file that can be run within FLIST to save
rem the environment to a CMD file.
rem
rem We save the environment by redirecting the output of the GENV program
rem to a file. If GENV detects that its output has been redirected it
rem writes 'SET' commands which can later be used to restore the environment.
rem
if .%1 == . goto Usage
if .%2 == . goto Doit
:Usage
echo Usage is:
echo %0 filename
echo Where filename is the name of the file to write the SET commands to.
mline
goto End
:Doit
if exist %1 goto Prompt
goto Newfile
:Prompt
MLINE "File %1 already exists - Action?" Overwrite Append Exit
if errorlevel 2 goto End
if errorlevel 1 goto Append
:Newfile
GENV > %1
goto End
:Append
GENV >> %1
:End