Have you had a test for B12 deficiency? I have. I went to my regular physician, asked for regular blood work (cholesterol, blood sugar, B12, etc). I was perfectly normal. If you don't have a deficiency, then B12 shots do nothing.
If you are worried about B12 but not sure if you are deficient, you can always take B12 vitamins.
Also forgot to add that there are various signs of B12 deficiency but one of them is depression (and also loss of appetite). So generally if you are deficient, you may be experiencing depression and B12 can help with mood. It doesn't help with weight loss though. There may also be a psychological factor in that if you think they help with weight loss, then they will.
You can't out-exercise poor eating habits.