home *** CD-ROM | disk | FTP | other *** search
/ Xentax forum attachments archive / xentax.7z / 7840 / WD_Repack.7z / WD_Bink.bat < prev    next >
Encoding:
DOS Batch File  |  2014-09-17  |  3.3 KB  |  116 lines

  1. @echo off
  2. mode 80,30
  3.  
  4. set BIKfilename=bink.exe
  5. set BRDfilename=radutil.dll
  6. set BMKfilename=binkmake.dll
  7.  
  8. set WD_EBink=WD_ErrorBink.txt
  9.  
  10. if NOT exist %BIKfilename% (
  11. echo.
  12. echo [%BIKfilename%] is not located in this folder...
  13. echo.
  14. goto :End
  15. )
  16.  
  17. if NOT exist %BRDfilename% (
  18. echo.
  19. echo [%BRDfilename%] is not located in this folder...
  20. echo.
  21. goto :End
  22. )
  23.  
  24. if NOT exist %BMKfilename% (
  25. echo.
  26. echo [%BMKfilename%] is not located in this folder...
  27. echo.
  28. goto :End
  29. )
  30.  
  31. :choice
  32. cls
  33. echo.
  34. echo *******************************************************************************
  35. echo *                                                                             *
  36. echo *                 Watch Dogs    ~    Rebuild BIK files to 50%%                 *
  37. echo *                                                                             *
  38. echo *                                                                             *
  39. echo *                                                                             *
  40. echo *       Press [1] to start the rebuilding procedure...                        *
  41. echo *       Press [2] to start the renaming procedure...                          *
  42. echo *                                                                             *
  43. echo *                                                                             *
  44. echo *       Remark:                                                               *
  45. echo *       You must download RADtools and copy the appropriate files             *
  46. echo *       to the current folder!                                                *
  47. echo *                                                                             *
  48. echo *       When finished, check the error log.                                   *
  49. echo *       If everything is ok, run the renaming procedure to restore            *
  50. echo *       the files back to their original name!                                *
  51. echo *                                                                             *
  52. echo *                                                                             *
  53. echo *  Current Folder:                                                            *
  54. echo *  [%~dp0]
  55. echo *                                                                             *
  56. echo *                                                                             *
  57. echo *******************************************************************************
  58. echo.
  59. set /p userinp=Type a number (0,1-2): 
  60. set userinp=%userinp:~0,1%
  61. echo.
  62. echo.
  63. if "%userinp%"=="0" (
  64. echo Quiting...
  65. goto :END
  66. )
  67. if "%userinp%"=="1" goto Start
  68. if "%userinp%"=="2" goto Brename
  69. echo invalid choice
  70. goto choice
  71.  
  72.  
  73. :Start
  74. %~d0
  75. cd %~dp0
  76.  
  77. type nul>%WD_EBink%
  78.  
  79. setlocal EnableDelayedExpansion
  80. set Count=0
  81.  
  82. for /F "delims=~" %%i in ('dir *. /b /A:-D') do (
  83. set /a Count=!Count!+1
  84. echo [!Count!]:  %%i
  85.  
  86. Bink %%i %%i_NEW.bik /D50 /M3.0 /L10 /B16 /C2 /^#
  87.  
  88. if not !ErrorLevel! equ 0 (
  89.     echo Bink error: %%i >> %WD_EBink%
  90. ) ELSE (
  91.     del %%i )
  92.  
  93. )
  94. goto choice
  95.  
  96.  
  97. :Brename
  98. %~d0
  99. cd %~dp0
  100.  
  101. setlocal EnableDelayedExpansion
  102. set Count=0
  103.  
  104. for /F "delims=~" %%i in ('dir *.bik /b') do (
  105. set name=%%~ni
  106. set name=!name:~0,-4!
  107. echo [!Count!]:  %%~ni    ~    [!name!]
  108. ren %%i !name!
  109.  
  110. )
  111. goto choice
  112.  
  113.  
  114. :END
  115. echo.
  116. pause