View Single Post
Old 08-18-2016, 11:27 AM   #2
eamonned
Junior Member
eamonned began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Aug 2016
Location: Munich, Germany
Device: (Kindle - Potentially)
Perhaps I've posted this in the wrong forum?

Anyways - here's version 1 of my fix for this

From the folder & subfolders containing the files that you wish to add to Calibre, execute something like this...

c:\Books\Hobbies\Woodworking>forfiles.exe /s /m *.pdf /c "cmd /c calibredb add --duplicates --tags ^0x22Woodworking, Hobbies, @fdate^0x22 @path"

Some explanation
forfiles.exe - for all of the files that match (/m)
/s - include subfolders
/m *.pdf - match all pdfs in my case
/c - for every file execute what follows
"cmd /c calibredb add
--duplicates - I want the process to continue even if it finds a duplicate
--tags ^0x22 Tag1, tag2, tag3 ^0x22 - the tags need to be surrounded by the Hexadecimal code for " (quotation marks) - this is the part that took my quite some time to figure out

@fdate - I included this within the Tags - it will add the files last modified date
@path - this is the book that is being processed and will be sent to Calibre with the given tags

So basically
Copy this line
forfiles.exe /s /m *.pdf /c "cmd /c calibredb add --duplicates --tags ^0x22%TAG_1%, %TAG_2%^0x22 @path"


and change %TAG_1% and %TAG_2% (or add others) as it suits you

Hope this helps someone

Best
/E
eamonned is offline   Reply With Quote