I want to automatically extract torrents downloaded with qBittorrent into the same directory. I have a bat F:\extrator.bat that contains.
@ECHO off
timeout /t 10 /nobreak
set arg1=%1
set arg2=%2
shift
shift
"C:\Program Files\WinRAR\WinRAR.exe" x "%arg1%" "%arg2%"
I call this from qBittorrent on download completion with
"F:\extractor.bat" "%F*.rar" "%F"
The qBittorrent log shows the args passed as arg1 = F:\Torrent\Finished\downloadname*.rar arg2 = F:\Torrent\Finished\downloadname
However Winrar reports an error stating that C:\Windows\System32\"F:\Torrent\Finished\downloadname*.rar" could not be found.
WinRar seems to add C:\Windows\System32\ to the beginning of arg1.
Anyone have any ideas why this is happening?
set arg1=%1
toset "arg1=%~1"
and see what happensThe.Housing.Enforcers.S04E07.720p.HDTV.x264-BARGE
contained in the archiveF:\Torrent\Finished\The.Housing.Enforcers.S04E07.720p.HDTV.x264-BARGE\the.housing.enforcers.s04e07.720p.hdtv.x264-barge.rar
. Is that so? I guess not. Probably you should omit"%arg2%"
completely.