Advertisement
Guest User

Untitled

a guest
Sep 18th, 2016
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.78 KB | None | 0 0
  1. @echo off
  2. echo V2
  3. c:
  4.  
  5. if exist "%ProgramFiles%\Handbrake\" goto prog_reg
  6. if exist "%ProgramFiles(x86)%\Handbrake\" goto prog_alt
  7. :: Can't find Handbrake in the regular directories
  8. echo Error: Handbrake not found!
  9. pause
  10. goto eof
  11.  
  12. :prog_alt
  13. cd "%ProgramFiles(x86)%\Handbrake\"
  14. goto recode
  15.  
  16. :prog_reg
  17. cd "%ProgramFiles%\Handbrake\"
  18. goto recode
  19.  
  20. :recode
  21. dir "%1\*.*" /b  > "%~dp1\dir.txt"
  22. dir "%1" > "%1\..\before.txt"
  23. mkdir "%1\recoded"
  24. FOR /F "delims=/" %%D in (%~dp1\dir.txt) do (
  25.  HandBrakeCLI --format av_mp4 --encoder x264 --vb 400  --two-pass --turbo --crop 0:0:0:0 --aencoder av_aac --ab 64 -i "%1\%%D" -o "%1\recoded\%%D"
  26. del "%1\%%D" /Q /F
  27. move "%1\recoded\%%D" "%1\"
  28.  
  29. )
  30.  
  31. del "%~dp1\dir.txt" /Q /F
  32. rmdir "%1\recoded" /Q /S
  33. dir "%1\" > "%1\..\after.txt"
  34.  
  35. :eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement