Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

srr_srs_folder.bat

By: a guest on Jul 25th, 2011  |  syntax: None  |  size: 2.59 KB  |  views: 268  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. @echo off
  2. title SRR/SRS Creation Script - Working
  3. pushd %1
  4. IF ERRORLEVEL 1 goto :eob
  5.  
  6. set sfvfilename=
  7. set sfvfilelist=
  8. set rarfilename=
  9. set buchoice=
  10. set subchoice=
  11.  
  12. REM Setting alwaysignoresubs to YES will avoid ever storing subs in the srrs.
  13. REM Setting alwaysstoresubs to YES will avoid being asked whether to store subs.
  14. REM Setting alwaysbackupsrrs to YES will avoid being asked whether to create a backup srr without subs.
  15.  
  16. set alwaysignoresubs=NO
  17. set alwaysstoresubs=YES
  18. set alwaysbackupsrrs=YES
  19.  
  20.  
  21. IF NOT EXIST CD? (
  22.  
  23.     for /f "delims==" %%d in ('dir /b *.sfv') do set sfvfilename=%%d
  24.     call set sfvfilelist=.\%~nx1\%%sfvfilename%%
  25.    
  26. ) ELSE (
  27.    
  28.     for /d %%t in (CD?) do (
  29.       call set sfvfilelist=%%sfvfilelist%% .\%~nx1\%%t\
  30.       pushd %%t
  31.       for /f "delims==" %%d in ('dir /b *.sfv') do set sfvfilename=%%d
  32.       call set sfvfilelist=%%sfvfilelist%%%%sfvfilename%%
  33.       popd
  34.     )
  35.  
  36. )
  37.  
  38. IF EXIST Sample (
  39.  
  40.   IF NOT EXIST CD? (
  41.  
  42.     (for /f "delims==" %%d in ('dir /b *.rar') do set rarfilename=%%d) 1>nul 2>nul
  43.     (for /f "delims==" %%d in ('dir /b *.part01.rar') do set rarfilename=%%d) 1>nul 2>nul
  44.     pushd Sample
  45.     for /f "delims==" %%d in ('dir /b *.avi *.mkv') do call srs %%d -c ..\%%rarfilename%%
  46.     popd
  47.  
  48.   ) ELSE (
  49.    
  50.     for /d %%t in (CD?) do (
  51.       pushd %%t
  52.       (for /f "delims==" %%d in ('dir /b *.rar') do set rarfilename=%%d) 1>nul 2>nul
  53.       (for /f "delims==" %%d in ('dir /b *.part01.rar') do set rarfilename=%%d) 1>nul 2>nul
  54.       popd
  55.       pushd Sample
  56.       for /f "delims==" %%d in ('dir /b *.avi *.mkv') do call srs %%d -c ..\%%t\%%rarfilename%%
  57.       popd
  58.     )
  59.    
  60.   )
  61.  
  62. )
  63.  
  64. pushd ..
  65. call srr %%sfvfilelist%% -s .\*.nfo .\*.jpg .\Sample\*.srs .\Sample\*.jpg -p -o %~nx1.srr -i .\%~nx1
  66. IF ERRORLEVEL 1 echo Creation of srr file failed. & goto :eob
  67.  
  68. if /i '%alwaysignoresubs%'=='YES' goto :eob
  69.  
  70. echo Checking for subtitles.
  71. if not exist .\%~nx1\Subs echo Subtitles folder doesn't exist. & goto :eob
  72.  
  73. if /i '%alwaysstoresubs%'=='YES' goto :backupsrrq
  74. set /p subchoice=Subtitles folder found, do you want them stored? [y/n]
  75. if /i not '%subchoice%'=='Y' goto :eob
  76.  
  77. :backupsrrq
  78. if /i '%alwaysbackupsrrs%'=='YES' goto :backupsrr
  79. set /p buchoice=Create a backup srr without subtitles? [y/n]
  80. if /i not '%buchoice%'=='Y' goto :srrstoresubs
  81.  
  82. :backupsrr
  83. call srr %~nx1.srr -s .\Subs\*.sfv -p -i .\%~nx1
  84. echo Creating Backup without subtitles: _%~nx1.srr
  85. call copy %~nx1.srr _%~nx1.srr
  86.  
  87. :srrstoresubs
  88. call srr %~nx1.srr -s .\Subs\*.rar -p -i .\%~nx1
  89.  
  90. :eob
  91. echo Exiting.
  92. pause
  93. title SRR/SRS Creation Script - Done