@echo off setlocal enabledelayedexpansion :: Set the directory where your torrent files are located set "TORRENT_DIR=torrents" :: Change to the directory containing the torrent files cd /d "%TORRENT_DIR%" :: Loop through each .torrent file in the directory for %%f in (*.torrent) do ( echo Adding %%f qbt torrent add file "%%f" ) echo All torrents have been added. pause