@echo Clean up - Delete all generated files...
@echo It requires a delete directory program called 'xdelete'
@echo This 'scary' tool can be obtained from http:/geoffair.net/ms/xdelete.htm
@echo *****************************************************
@echo ARE YOU SURE YOU WANT TO DO THIS? Ctrl+C to ABORT ...
@echo *****************************************************
@pause
@echo *** REALLY CONTINUE? *** Last chance ;=)) Ctrl+C to abort...
@pause
@echo Cleaning up...
@if EXIST *.old echo Deleting *.old ...
@if EXIST *.old Del *.old > nul
@if EXIST *.bak echo Deleting *.bak ...
@if EXIST *.bak Del *.bak > nul
@if NOT EXIST temp*.* goto dntmp
@echo	Delete temp*.* ...
@del temp*.* > nul
:dntmp
@if NOT EXIST *.obj goto dnobj
@echo	Delete *.obj ...
@del *.obj > nul
:dnobj
@if NOT EXIST *.err goto dnerr
@echo	Delete *.err ...
@del *.err > nul
:dnerr
@if NOT EXIST *.pdb goto dnpdb
@echo	Delete *.pdb ...
@del *.pdb > nul
:dnpdb
@if NOT EXIST *.lst goto dnlst
@echo	Delete *.lst ...
@del *.lst > nul
:dnlst
@if EXIST *.pch echo Deleting *.pch ...
@if EXIST *.pch Del *.pch > nul
@if EXIST *.ilk echo Deleting *.ilk ...
@if EXIST *.ilk Del *.ilk > nul
@if EXIST *.NCB echo Deleting *.NCB ...
@if EXIST *.NCB Del *.NCB > nul
@if EXIST *.plg echo Deleting *.plg ...
@if EXIST *.plg Del *.plg > nul
@if EXIST *.OPT echo Deleting *.OPT ...
@if EXIST *.OPT Del *.OPT > nul
@if EXIST *.idb echo Deleting *.idb ...
@if EXIST *.idb Del *.idb > nul
@if EXIST *.aps echo Deleting *.aps ...
@if EXIST *.aps Del *.aps > nul
@if EXIST *.sbr echo Deleting *.sbr ...
@if EXIST *.sbr Del *.sbr > nul
@if NOT EXIST *.suo goto DNSUO
@attrib -S -R -H *.suo > nul
@if EXIST *.suo echo Deleting *.suo ...
@if EXIST *.suo Del *.suo > nul
:DNSUO
@if EXIST *.user echo Deleting *.user ...
@if EXIST *.user Del *.user > nul
@echo Now to delete the Debug and Release folders...
@if NOT EXIST Debug\. goto DNDBG
xdelete Debug -dfrm
:DNDBG
@if NOT EXIST Release\. goto DNREL
xdelete Release -dfrm
:DNREL

@echo All done ...
