Same idea but with some modifications:
SQLite recognize referential integrity now:
CREATE TABLE Table_a (
id int,
file_name varchar(300),
folder_id int,
FOREIGN KEY(folder_id) REFERENCES Table_b (folder_id)
);
CREATE TABLE Table_b (
folder_id int,
folder_path varchar(300)
);
CREATE TABLE Table_b (folder_id, folder_path) VALUES (1, 'c:\abc\somefolder\another');
CREATE TABLE Table_b (folder_id, folder_path) VALUES (2, 'c:\abcNOT\somefolder\another');
CREATE TABLE Table_a (id, file_name, folder_id) VALUES (1, 'file1.txt', 1);
CREATE TABLE Table_a (id, file_name, folder_id) VALUES (1, 'file2.txt', 1);
CREATE TABLE Table_a (id, file_name, folder_id) VALUES (1, 'file2-1.txt', 2);
DELETE
FROM Table_a
WHERE folder_id IN (SELECT folder_id FROM Table_b WHERE folder_path LIKE 'c:\abc\%');
SELECT * FROM Table_a;