@if NOT EXIST setup.bat goto ERR1
call setup
call mdd temp
@if NOT EXIST ..\append.bat goto ERR4

touch file1
@if NOT EXIST file1 goto ERR2
touch file2
%TEMPT% cf archive file1
@if NOT EXIST archive goto ERR3
%TEMPT% rf archive file2
%TEMPT% tf archive > tempout1.txt
@type tempout1.txt
@echo Ouput should be -
@echo file1> tempout2.txt
@echo file2>> tempout2.txt
@type tempout2.txt
%TEMPC% tempout1.txt tempout2.txt < ..\n.txt
@cd ..
@goto END

:ERR1
@echo Can NOT locate setup.bat ... check name, location ...
@goto END

:ERR2
@echo ERROR: Failed to create file1 ... perhaps 'touch', touch.exe is NOT in PATH ...
@goto WAIT

:ERR3
@echo ERROR: Failed to create archive ... perhaps %TEMPT% is NOT in available ...
@goto WAIT

:ERR4
@echo ERROR: Failed to create temp directory ... perhaps mdd.bat is NOT in available ...
@pause
@goto END

:WAIT
cd ..
@pause
@goto END

:END
