Advertisement
jcunews

dirs2rars.bat

Sep 23rd, 2019 (edited)
624
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.42 KB | None | 0 0
  1. @echo off
  2. setlocal
  3. if "%~2" == "" (
  4.   echo Usage: dirs2rars {source folder} {rars folder}
  5.   goto :eof
  6. )
  7. set rarpath="c:\program files\winrar\winrar.exe"
  8. pushd %1
  9. if errorlevel 1 (
  10.   echo Source folder is not found.
  11.   goto :eof
  12. )
  13. if not exist "%~2\nul" (
  14.   echo Destination folder is not found.
  15.   goto :eof
  16. )
  17. for /d %%A in (*) do (
  18.   pushd "%%A"
  19.   start /b /wait "" %rarpath% a -r -s "%~2\%%~nxA.rar"
  20.   popd
  21. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement