I use this to create a catalog that contains the paths. You can probably modify it to work for you. (I don't really remember why this works, but I understood it once upon a time)
calibredb.exe catalog "C:\Users\smill\Dropbox\My Calibre\Catalog.epub" --generate-authors --generate-descriptions --generate-series --generate-titles --header-note-source-field=#paths
|