What? I need to write more than that? Hmm... ok...
Generally speaking (I say generally speaking, because there's a part of me that rebels against the idea of breaking down our complex bodily metabolic processes to a simple mathematical formula), if you take in less calories than your body uses, you'll lose weight, if you take in more, you'll gain weight.
Notice the use of the phrase "take in" there instead of "eat".
One of the main causes of weight gain that people don't always think of is alcohol. Beer has calories. Wine has calories. Spirits have calories. That strange bottle of red syrupy liquid that your aunt gave you for your birthday, with a hand scrawled label that you can't quite make out (drink at your own peril!), that has calories.
I used to make a smoothie concoction in my NutriBullet for breakfast and drink it on my way to work. After a little experimentation, I managed to pack around 1000 calories into it (pro tip: peanut butter is awesome for packing in additional calories). I used this to put on some extra muscle mass, and it worked really well.
As long as you're getting the main bulk of your calories from real, whole foods (meat, fish, vegetables and fruit, plus beans and legumes if your body can handle them), then there's nothing wrong with adding in a protein drink to get the extra calories in.
What I like to do is work out my rough maintenance caloric intake (last time I checked it was around 3300 calories), that being the amount of calories you can eat and maintain your bodyweight and composition, then up it by something like 250 to gain some mass, or drop it by the same amount to lose. If I'm looking to gain, I'll normally add a can of sardines and an avocado to my diet somewhere during the day, but there's nothing to say it couldn't be a protein shake instead.
Long time ago, a pregnant friend of mine suffered from all day morning sickness, stopped eating and started losing weight at a worrying rate (not great for a pregnant lady). She was prescribed what were essentially protein drinks to try and gain back some of the weight she'd lost. They worked.
So, long, wordy answer shortened, yes, increasing your daily caloric intake more than the required limit, solely by protein drinks, will help you put on weight.