I would load the data into a staging table with bulk insert, then insert the date into the batch table, and finally insert the data from the staging table into your Files table with the identity value from the batch table. BTW, I would use SCOPE_IDENTITY(). From BOL:
SCOPE_IDENTITY and @@IDENTITY will return last identity values generated in any table in the current session. However, SCOPE_IDENTITY returns values inserted only within the current scope; @@IDENTITY is not limited to a specific scope.
Luck, Dave