@echo off
rem ****** CHECK IF COPY WANTED **************************
usrchar Do you want to copy a file? (Y/N)\c yn
IF ERRORLEVEL 2 GOTO END

rem ****** GET THE INPUT FILENAME ************************
usrprmpt Enter the source filename:\c -r
call setenv "IN=@usrprmpt.tmp"

rem ****** CHECK IF THIS FILE EXISTS *********************
test -r "$IN" runneg: echo FILE %IN% DOES NOT EXIST
IF ERRORLEVEL 1 GOTO END

rem ****** GET THE OUTPUT FILENAME ***********************
echo Enter the destination filename:
call setenv "OUT=`line`"

rem ****** CHECK IF IT IS WRITABLE IF IT EXISTS **********
test -r $OUT 
IF ERRORLEVEL 1 GOTO DO_COPY
test -w $OUT runneg: echo CANNOT WRITE TO FILE %OUT%
IF ERRORLEVEL 1 GOTO END

rem ****** EXECUTE THE ACTUAL COPY ***********************
:DO_COPY
cp -l %IN% %OUT%
goto END

:END
