A new battery in the car shouldn't change the functionality of the key fob unless the alarm is going off. The security code might be on a card in the manual book, if not you will need to remove the radio, get the number off the back, call BMW, and prove you are the owner. What model BMW do you own?