home *** CD-ROM | disk | FTP | other *** search
/ Xentax forum attachments archive / xentax.7z / 7840 / WD_Repack.7z / WD_XBT-ConvertXBT.bat < prev    next >
Encoding:
DOS Batch File  |  2014-09-18  |  2.0 KB  |  70 lines

  1. @echo off
  2.  
  3. :choice
  4. cls
  5. echo.
  6. echo *******************************************************************************
  7. echo *                                                                             *
  8. echo *                 Watch Dogs    ~    Create DDS =^> XBT Files                  *
  9. echo *                                                                             *
  10. echo *       Recreates all XBT files based on its resp. DDS and HDR files          *
  11. echo *                                                                             *
  12. echo *                                                                             *
  13. echo *       Press [1] to start the building procedure...                          *
  14. echo *                                                                             *
  15. echo *                                                                             *
  16. echo *  Current Folder:                                                            *
  17. echo *  [%~dp0]
  18. echo *                                                                             *
  19. echo *                                                                             *
  20. echo *******************************************************************************
  21. echo.
  22. set /p userinp=Type a number (0,1): 
  23. set userinp=%userinp:~0,1%
  24. echo.
  25. echo.
  26. if "%userinp%"=="0" (
  27. echo Quiting...
  28. goto :END
  29. )
  30. if "%userinp%"=="1" goto Start
  31. echo invalid choice
  32. goto choice
  33.  
  34.  
  35. :Start
  36. set WD_FList=WD_FListGraph.txt
  37. set WD_Alist=WD_AlphaList.txt
  38. set WD_FinalList=WD_FinalList.txt
  39. set WD_EList3=WD_ErrorList3.txt
  40.  
  41. type nul > %WD_EList3%
  42.  
  43. dir *.dds /b>WD_FListGraph.txt 2>nul
  44.  
  45. %~d0
  46. cd %~dp0
  47.  
  48. setlocal EnableDelayedExpansion
  49. Set Count=0
  50. for /F "delims=~" %%i in (%WD_FList%) do (
  51. set /a count=!count!+1
  52. echo !count!
  53.  
  54. copy /b "%%~ni".hdr+%%i "%%~ni".xbt >nul 2>nul
  55.  
  56. if not !ErrorLevel! equ 0 ( 
  57.     echo Copy Header error: %%i >> %WD_EList3%
  58. ) ELSE (
  59.     del "%%i" "%%~ni.hdr"
  60. )
  61.  
  62. )
  63.  
  64.  
  65. :END
  66.  
  67. del %WD_FList% >nul 2>nul
  68.  
  69. echo.
  70. pause