Gfy

$$fix$$.bat

Gfy
Oct 21st, 2011
148
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. YopoM   ok, made a stand alone .. batch file, hah .. that fixes the problem. Simplistic, but anyone can run, only needs to have DEBUG.EXE and MOVE.EXE in the windows dir (some of those lite versions might not)
  2. http://www.srrdb.com/details.php?release=Psych.S06E02.HDTV.XviD-P0W4
  3.  
  4.  
  5. @echo off
  6. REM ----------------
  7. REM $$fix$$.bat
  8. REM ----------------
  9. REM  . Fix rar files recreated with srr that have a 20 byte type 0 block at end
  10. REM ----------------
  11. REM  .... Quick fix, this only works on .rxx files, not any partxx types
  12. REM ----------------
  13.  
  14.  
  15. REM Trap rars not handled
  16. FOR %%T in (part1 part01 part001) do IF EXIST *.%%T.rar goto err1
  17. REM Check size of rar
  18. SET @@p=
  19. FOR %%T in (*.rar) do SET @@p=%%~zT
  20. IF NOT "%@@p%"=="14999980" goto err2
  21. REM Create patch file via debug.exe
  22. ECHO n $tmp$>$
  23. ECHO e 100 00 00 00 00 00 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00>>$
  24. ECHO rcx>>$
  25. ECHO 14 >>$
  26. ECHO w 100>>$
  27. ECHO q>>$
  28. debug<$
  29. REM Get base name of rar files
  30. FOR %%T in (*.rar) do SET @@p=%%~nT
  31. ECHO Fixing rars now (%@@p%.*)
  32. IF NOT EXIST _OLD MD _OLD
  33. FOR %%T in (ar 00 01 02 03 04 05 06 07 08 09) DO IF EXIST %@@p%.r%%T (REN %@@p%.r%%T %@@p%.r%%T.old&copy /y /b %@@p%.r%%T.old+$tmp$ %@@p%.r%%T>NUL&move /y %@@p%.r%%T.old _OLD>NUL)
  34. FOR %%T in (10 11 12 13 14 15 16 17 18 19) DO IF EXIST %@@p%.r%%T (REN %@@p%.r%%T %@@p%.r%%T.old&copy /y /b %@@p%.r%%T.old+$tmp$ %@@p%.r%%T>NUL&move /y %@@p%.r%%T.old _OLD>NUL)
  35. FOR %%T in (20 21 22 23 24 25 26 27 28 29) DO IF EXIST %@@p%.r%%T (REN %@@p%.r%%T %@@p%.r%%T.old&copy /y /b %@@p%.r%%T.old+$tmp$ %@@p%.r%%T>NUL&move /y %@@p%.r%%T.old _OLD>NUL)
  36. FOR %%T in (30 31 32 33 34 35 36 37 38 39) DO IF EXIST %@@p%.r%%T (REN %@@p%.r%%T %@@p%.r%%T.old&copy /y /b %@@p%.r%%T.old+$tmp$ %@@p%.r%%T>NUL&move /y %@@p%.r%%T.old _OLD>NUL)
  37. FOR %%T in (40 41 42 43 44 45 46 47 48 49) DO IF EXIST %@@p%.r%%T (REN %@@p%.r%%T %@@p%.r%%T.old&copy /y /b %@@p%.r%%T.old+$tmp$ %@@p%.r%%T>NUL&move /y %@@p%.r%%T.old _OLD>NUL)
  38. FOR %%T in (50 51 52 53 54 55 56 57 58 59) DO IF EXIST %@@p%.r%%T (REN %@@p%.r%%T %@@p%.r%%T.old&copy /y /b %@@p%.r%%T.old+$tmp$ %@@p%.r%%T>NUL&move /y %@@p%.r%%T.old _OLD>NUL)
  39. FOR %%T in (60 61 62 63 64 65 66 67 68 69) DO IF EXIST %@@p%.r%%T (REN %@@p%.r%%T %@@p%.r%%T.old&copy /y /b %@@p%.r%%T.old+$tmp$ %@@p%.r%%T>NUL&move /y %@@p%.r%%T.old _OLD>NUL)
  40. FOR %%T in (70 71 72 73 74 75 76 77 78 79) DO IF EXIST %@@p%.r%%T (REN %@@p%.r%%T %@@p%.r%%T.old&copy /y /b %@@p%.r%%T.old+$tmp$ %@@p%.r%%T>NUL&move /y %@@p%.r%%T.old _OLD>NUL)
  41. FOR %%T in (80 81 82 83 84 85 86 87 88 89) DO IF EXIST %@@p%.r%%T (REN %@@p%.r%%T %@@p%.r%%T.old&copy /y /b %@@p%.r%%T.old+$tmp$ %@@p%.r%%T>NUL&move /y %@@p%.r%%T.old _OLD>NUL)
  42. FOR %%T in (90 91 92 93 94 95 96 97 98 99) DO IF EXIST %@@p%.r%%T (REN %@@p%.r%%T %@@p%.r%%T.old&copy /y /b %@@p%.r%%T.old+$tmp$ %@@p%.r%%T>NUL&move /y %@@p%.r%%T.old _OLD>NUL)
  43. ECHO.
  44. ECHO Finished, old rar files are in _OLD
  45. goto alldone
  46.  
  47. :err1
  48. ECHO partx partxx and partxxx rar types not supported
  49. goto alldone
  50. :err2
  51. if "%@@p%"=="" ( ECHO No rars found&GOTO alldone )
  52. ECHO No truncated rars found.
  53.  
  54. :alldone
  55. REM Post Cleanup
  56. FOR %%T IN ($ $tmp$) do if exist %%T del %%T
  57. SET @@p=
  58.  
  59.  
RAW Paste Data