Author Topic: Shutdown Qbittorrent when disk space is low, windows version  (Read 190 times)

markifi

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Shutdown Qbittorrent when disk space is low, windows version
« on: March 28, 2019, 01:26:44 pm »
1 you need Autohotkey for this
2 qBittorrent needs to be configured so it doesn't close to the system tray (options / behaviour / uncheck close qbittorrent  to notification area)

3 you should put this in your shell:startup in an .ahk file:
Code: [Select]
SetTimer, CheckDriveSpace, 120000 ;modify this number to a lower one if you have more than a 100 Mbit/s connection
CheckDriveSpace:
DriveSpaceFree, FreeSpace, c:\
If FreeSpace < 1000
{
RunWait, cmd /c taskkill /im qbit*
MsgBox, qBittorrent has been shut down automatically,`ncheck free space!
}
Else
Return
Return

real simple. it can crash some of your torrents though, but that's better than the alternative of the certain catastrophic failure that qBittorrent does on running out of space. (at least it used to be like that)