Accessing BOMs without opening files is pretty much the solidly in the realm of SOLIDWORKS PDM (formerly Enterprise PDM). If you are not using SWPDM, opening files directly is the main method.
You can do this via Document Manager API (you can get the free key for this library if you are on subscription). Then you can either read the content of existing BOM table via SwDMDocument10::GetTable. Or create a composed BOM table by traversing the components and custom properties SwDMConfiguration2::GetComponents.
Document Manager allows to read this metadata directly from the file so you neither need to open the file in SW nor even have SolidWorks installed. You will be able to extract the data from thousands of files in seconds.