This usage developed around the beginning of the 20th century, very much associated with the slang of the social class described by such authors as P G Wodehouse. Its origins relate to the idiom "to have bats in the belfrey", referring to people whose behaviour is wildly unpredictable or eccentric, and is thus equivalent to "crazy, dotty". None of this was relevant in Shakespeare's time. In an original and solitary instance, he attaches one of his favourite word-coining suffixes, - y (as in vasty, plumpy, steepy) to bat to produce an adjective with the literal meaning:
"bat-like". In A Midsummer Night's Dream, Oberon tells Puck about the Athenians: "o'er their brows death-counterfeiting sleep With leaden legs and batty wings doth creep" (III.ii.365). It is a vivid coinage - but it never caught on. There is just one other recorded example in the Oxford English Dictionary, from a naturalist in 1883.
David Crystal is author, with Ben Crystal, of Shakespeare's Words, published by Penguin