What's wrong with my batch file for unraring with winrar?

176 Views Asked by At

I'm having troubles going from 7zip to Winrar. The batch script goes into every subdir and extracts whatever rar-files in them to D:\Stuff\Testfolder

My current (working) batch file for 7zip looks like this:

FOR /D /r %%F in ("*") DO (
    pushd %CD%
    cd %%F
        FOR %%X in (*.rar) DO (
            "C:\Program Files\7-zip\7z.exe" x "%%X" -oD:\Stuff\Testfolder -y
        )
    popd
)

However, trying it on Winrar by using the same file with the executable line changed to:

 "C:\Program Files\winrar\unrar.exe" x "%%X" D:\Stuff\Testfolder -y

Nothing happens. All I get is an output of the current directory.

Anyone have some input on this?

Cheers Tobbe

1

There are 1 best solutions below

0
On

Do like this....

"C:\Program Files\WinRAR\unrar.exe" x "%%~nX.rar" "D:\Stuff\Testfolder\" 

If you want to read more....