@setlocal
@echo update perl samples... batch update 20131012 - 2009-06-24...
@set TEMP1=samples
@if EXIST %TEMP1%\nul goto ERR1
@set TEMP2=c:\HOMEPAGE\GA\mperl\samples
@if NOT EXIST %TEMP2%\. goto ERR2
@set TEMP3=p2hall03.pl
@if NOT EXIST %TEMP3% goto ERR3
@set TEMP4=C:\MDOS\dc4w.exe
@if NOT EXIST %TEMP4% goto ERR4
@echo Continue with UPDATE?
@pause
@echo Making work directory...
md %TEMP1%
@if NOT EXIST %TEMP1%\. goto ERR5
@echo Copying existing stuff to work directory...
xcopy /E %TEMP2%\*.* %TEMP1%\.

@echo Processing work directory...
call %TEMP3%
@if ERRORLEVEL 1 goto ERR6

@echo Comparing folders...
%TEMP4% %TEMP1% %TEMP2%
@goto END

:ERR1
@echo ERROR: Folder [%TEMP1%] already exists...
@echo This batch file will create the folder, and copy the current sample files...
@echo Delete folder and re-try...
@goto END

:ERR2
@echo ERROR: Can NOT locate folder [%TEMP2%] ... check and re-try ...
@goto END

:ERR3
@echo ERROR: Can NOT locate file [%TEMP3%] ... check and re-try ...
@goto END

:ERR4
@echo ERROR: Can NOT locate file [%TEMP4%] ... check and re-try ...
@goto END

:ERR5
@echo ERROR: Folder [%TEMP1%] could NOT be create... check and re-try ...
@goto END

:ERR6
@echo ERROR: Error exit on script %TEMP3%... check and re-try ...
@goto END

:END
