Batch run script on all .blend in directory and subdirectories

Hi there,
Does anyone have a method for applying a script to all .blend files in a directory (and all subdirectories)?
I would like to run following code (plus save the file), which is for vray exporter due to a change of how the diffuse colour is stored. I need to update library of objects.

import bpy

for ma in
    ma.vray.BRDFVRayMtl.diffuse = ma.diffuse_color

Thanks for any help:)

Looks like the --python command line argument will do the job. Just need to make a script to find and open the files.