Updated Sept 30, 2016 with the shifting of Protictis to the Carnivora.
Here on this YouTube video
is a bat hanging upside-down on a branch (Fig. 1). And then it takes off and flies. At first it doesn’t go anywhere, but it is flying/hovering after the feet finally let go of the branch.
Note, like roterosaurs and birds,
the bat is also bipedal — only upside-down, so balancing on hind limbs is not an issue for bats. Hanging upside down is nearly universal in bats.

Figure 1. Is this the origin of bat flapping. From an inverted position, this bat rises to horizontal by flapping, still clinging to its perch until release and flight. Click to open video.
With bipedal birds and pterosaurs,
wings appeared to develop first as decorative ornaments and flapping appears to have developed as a secondary sexual behavior to enhance feathers, plumes, hairs, and membranes already in place.
Bats were never glitzy.
They were always dull and brown. They never developed elaborate pre-sex mating rituals. They were never visual creatures. So elaborate frills and colors never appeared on them.
Since bats hang bipedally inverted,
their forelimbs and especially their hands were free to develop into something else. In this case foldable wings. But to get there, everyone knows, there had to be transitional phases in bat evolution, each phase fully functioning and conferring a competitive or survival advantage. Those transitional phases have not been discovered yet in the fossil record, nor have they been visualized. One problem has been a lack of phylogenetic bracketing, which only reptileevolution.com has provided (Fig. 2, as far as I know). Even so this is a fairly broad bracket.

Figure 2. Chriacus and Onychonycteris nest as a sister to the undiscovered bat ancestor and a basal bat. Miniaturization was part of the transition. So was enlargement of the manus. It is still a mystery why the transitional form decided to start flapping.
Taxa in our phylogenetic bracket:
At present we have Chriacus without wings and Onychonycteris with wings.

Figure 4. Ptilocercus, Icaronycteris and a hypothetical transitional taxon based on the ontogenetically immature wing of the embryo Myotis. If you’re going to evolve wings it looks like you have to stop using them as hands early on. Note in the bat embryo there is little indication of inter-metacarpal muscle. That area looks identical to the web.
Chriacus did not flap. Onychonycteris did.
Both were arboreal, long-limbed mammals. The big question everyone has been wondering is the how and why for transitional taxon flapping.
In the above video
we can see the inverted bat rising to a horizontal configuration while flapping and maintaining its perch with its hind limbs. This same action could be done with smaller wings in incremental steps, with advancements originating with little to no membrane and improving to a full-fledged membrane and extended fingers.
Note,
in pre bats this would not be considered flying. Instead it might be considered rowing through the air. And, except for grounded bats, there is little to no contribution from the hind limbs in becoming airborne. Instead, they simply let go. This is in direct contrast to colugos, Ptilocercus, primates, and arboreal pre-rabbits, all of which had leaping hind limbs.
The next question is,
why would an inverted bat want to rise to a horizontal configuration when it has no intention of flying?
To get to the other branch
when a pre-bat detected an insect on another branch. (Before it could attack flying insects, a prebat had to attack crawling insects, some of which were resting after a flight or were just crawling out of a pupae or hive.)
The above video was taken in a lab environment
with a single branch and a single bat. In the natural world of the Paleocene there would have been more branches available (perhaps a tangle of vines and branches). Rising to the horizontal by vigorous flapping would have put other branches within reach. Evidently, once bats had traded grasping hands for flapping hands with grasping thumbs, there was no turning back. A horizontal branch works better than a tree trunk in providing clearance for flapping arms/wings.
Bats are not like slow-moving colugos.
When not hibernating or resting, bats are active little engines of flight. We can imagine their unknown ancestors were also active little predators, with an unusual method for getting around. From vines and branches to open air flying, they took risks, experienced failure as they parachuted into the leaf litter, then climbed another tree to start all over again. Over time some bats found they could reach further branches by flapping faster, with larger strokes with longer fingers provided with broader membranes.
Bat flight is different than bird and pterosaur flight.
According to Tian et al. 2006, “The kinematic data reveals that, at the relatively slow flight speeds considered, that the wing motion is quite complex, including a sharp retraction of the wing during the upstroke and a broad sweep of the fully extended wing during the downstroke. In some respects it is almost like the animal is “rowing” rather than flying!”
In other words,
bats don’t rely so much on