How to batch replace reference files in a bunch of drawings.

Before i begin please be aware that i have tried "RefRename.mvba" and it was unsuccessful.

Here is what i am trying to do.

I have a set of drawings (D1-D10), who each reference a drawing (R1) twice and have logical names TOP and BOT in all 10 dwgs.

refrename.mvba does not like when the same file is reference twice.

What i am looking for is a script / batch processes to replace R1 with R2 for both TOP and BOT in all drawings D1-D10.

extra info: D1-D10 are all in the same directory A and R1 and R2 are both in the same directory B

Any and all help is greatly appreciated. Thank you