0

I want to compress all the folders that contain the word (Album), these folders have the following structure

Michael Jackson\Invincible (Album)
Michael Jackson\Thriller (Album)
Luciano Pavarotti\'O sole mio (Single)
Queen\Bohemian Rhapsody (Single)

So far I've tried this, but it doesn't work for me.

@echo off
setlocal enabledelayedexpansion
for /f "tokens=*" %%f in ('dir /s /b /ad "*(Album)"') do (
    set "filename=%%~nf"
    "%ProgramFiles%\WinRAR\Rar.exe" a -ep1 -idq -r -y %filename%
    echo %filename%
)
pause
0

Troubleshoot the problem as follows

@echo off
setlocal enabledelayedexpansion
for /f "tokens=*" %%f in ('dir /s /b /ad "*(Album)"') do (
    set "filename=%%~nf"
    "%ProgramFiles%\WinRAR\Rar.exe" a "-cpNo compression" -ep1 -r -y "%%~nf.rar" "%%~f"
)
pause

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.