I would be inclined to drive it to the dealer as-is. My fear would be that disconnecting the battery "fixes" it for now, and when you do go to the dealer they can't get the problem to repeat so they send you on your way and say "let us know if it happens again." Then, it does happen again and you've got another 45 minute drive to the dealer.
I had a dealer do this exact thing twice on a problem I was having with my 6. I would start it up, check engine light would come on and if the headlights were on it would blow the lights. Once the engine was turned off the CEL would go away. After the first time they replaced the headlights, looked at it for two hours and found nothing. A few weeks later, same thing happened out of the blue when starting it one day and CEL came on. By the time I got it to the dealer the next day CEL was off and they couldn't find anything. Finally the third time I went straight to the dealer without an appointment or phone call and pulled right into their bay and made them look at it then and there. They ended up replacing the voltage regulator and no problems since. Point is, if whatever issue you are having is not going on when you bring it in, or can be replicated you may be looking at several frustrating trips.
Good luck!