qbittorrent / qBittorrent

qBittorrent BitTorrent client
https://www.qbittorrent.org
Other
28.05k stars 3.96k forks source link

External Program Execution Fails Because rars are "being used by another process" #16559

Open jklassen opened 2 years ago

jklassen commented 2 years ago

qBittorrent & operating system versions

qBittorrent: 4.4.1 (x64) Windows 10 (10.0.1xxxx)

What is the problem?

I have a batch file that runs after a download is complete via the "Run external program on torrent completion" but it fails with the following error (Changed the folder/file names):

Here is the batch file "C:\Program Files\7-Zip\7z.exe" e "%1\*.rar" -o"%1\" >> "%SYSTEMDRIVE%\7z-logs.txt" 2>> %SYSTEMDRIVE%\7z-errors.txt

Here is 7z-logs.txt:

START [2022-02-28/23:36:40.70] 

7-Zip 19.00 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21

Scanning the drive for archives:
1 file, 150000000 bytes (144 MiB)

Extracting archive: F:\theFolder\theFile.rar

Can't open as archive: 1
Files: 0
Size:       0
Compressed: 0
END [2022-02-28/23:36:40.74] 

and here is 7z-errors.txt:

ERROR: F:\thefolder\thefile.rar
Can not open the file as archive

The process cannot access the file because it is being used by another process.

Seems to me like there needs to be some kind of delay before this script is run.

MORE CONTEXT: I do not have any automatic file management in qbittorrent enabled.

Steps to reproduce

Running the batch works standalone. Fails when using the run after complete command in QBittorrent

Additional context

No response

Log(s) & preferences file(s)

No response

jklassen commented 2 years ago

I added a ping localhost -n 5 in the batch file just before the line that executes 7zip and that fixed the file usage conflict. It's weird I need to do this but whatever, its not much of a workaround.

luzpaz commented 1 year ago

Related to #10206