Morning Martin
You can buy the batteries if you need to repair the key fob, plenty of videos around showing how too do it
If you don't have one a BMW specific code reader will prove invaluable, something like BMW 1.4.0, INPA, Carly for BMW, I use 1.4.0 which is mounted on on an old laptop which I keep just for garage work.
Is yours 3.0, 4.4, or 4.6 like mine?
Dave