As far as I know, there is no menu or switch setting that would cause this type of behavior. Does it happen with just the CF card or just the SD card? If it is just the CF card, get a flashlight and look into the slot to check for any bent pins. If it is isolated to the CF or SD, try a different card if you have another.
All that said, if you bought the camera from a local shop, I would return to the store. They'll have CF and SD cards and can check yours in their display model. It could very well be the camera itself so I would not delay because you would definitely be better off with an exchange than sending a new camera off to Nikon repair.