Microsoft's shareholders had little to grumble about on Wednesday as they shuffled into its annual meeting, held in the outskirts of Seattle. The 43-year-old software company, not long ago seen as a dinosaur of the tech industry, has in recent months overtaken its younger peers, Amazon and Google, in value.
This week, it went one better. On Monday, Microsoft leapfrogged its old rival Apple for the first time since 2010, making it the world's most valuable public company for the first time in 16 years. Since Monday, the two have repeatedly traded the top spot. The moment caps an extraordinary comeback for a company that many were prepared to consign to history.
Not many companies have second chances, especially one that had become as monolithic as Microsoft.
In early 2009, when its share price was at its lowest point this century, the company was reeling from the disastrous launch of Windows Vista, the long-awaited but bug-riddled successor to its wildly successful predecessor Windows XP. The Zune, its supposed iPod-killer, had become a bad joke. Internet Explorer's dominance over the web was being gradually chipped away by a not-for-profit browser called Firefox and the newly-released Google Chrome. In the first quarter of the year, Microsoft's revenues fell, for the first time in its 23 years as a public company.
And while it had spent its time trying to fix its numerous problems, including a long-running antitrust battle with the European Commission, Apple had launched the product that would change the computing world for good. The iPhone, released in 2007, caught Microsoft flat-footed. Steve Ballmer, Microsoft's chief executive, famously laughed it off, saying it would never seize more than 4 per cent of the market.
Ballmer, who had taken charge of Microsoft from Bill Gates in 2000, could not have been more wrong, a fact that was made abundantly clear when, in 2010, Apple's value surpassed that of its old rival. Even the death of Steve Jobs, who in earlier years had enjoyed nothing more than taking a pop at Bill Gates, did not slow Apple down, and a year later it became the world's most valuable company, surpassing the oil giant ExxonMobil.
Meanwhile, Microsoft was horribly weighed down by internal bureaucracy and infighting. At times, the company seemed more at war with itself than with its competitors. Little wonder, then, that it missed the three great consumer waves of the 21st century: search engines, social networking and smartphones. Its lack of direction was exemplified by the €5.4 billion ($8.95b) purchase of Nokia's mobile phone division in 2013, a move that came far too late to work, if it ever could have. At the time, it seemed more likely that Microsoft would go the way of IBM and HP: a company that, albeit still valuable, had its best days behind it.
But in 2018, Microsoft's floundering looks like a blessing in disguise, as the markets it missed out on suddenly look less valuable.
The smartphone market remains highly profitable, but sales are falling in what analysts have termed a "recession". The digital advertising market that powers Google is showing some signs of running out of puff. And the less said about social networks these days, the better. Microsoft's own foray into the space, its US$26b ($37.84b) acquisition of LinkedIn two years ago, has largely avoided the storm that Facebook and Twitter have been battling.
One could argue that had Microsoft been in any way successful in any of these areas it would be in worse shape right now. But by the time Satya Nadella replaced Ballmer in 2014, it knew it had to try move on.
Under Nadella, Microsoft has not exactly abandoned the everyday consumer, but neither are they a priority. The company's attention is largely focused on getting businesses to adopt its corporate offerings - its Office software such as Word, Outlook and Excel - and its computer server business.
But its most notable success has been the cloud computing division Azure, a business that few outside the tech industry have heard of. Companies using Azure gain access to Microsoft's data centres, which allow them to run applications and host services without having to buy their own hardware. It is not as glamorous a business as smartphones, but it is growing much faster: Azure revenues increased by 76 per cent in Microsoft's most-recent quarter. Meanwhile, a series of other bets appear to be paying off. HoloLens, the company's augmented reality headset, has hardly become the mass-market product that Microsoft might have hoped when it was first announced almost four years ago, but on Wednesday the company revealed it had won a US$480m ($699.9m) contract to supply them to the US military. Other businesses, such as its Surface tablets and Xbox gaming console, have been reinvented in recent years, leading to healthy growth.
For years, it looked as if Microsoft was losing in the areas of the tech industry that really mattered. What investors did not see at the time is that its time in the wilderness allowed it to reinvent itself. As the rest of the industry struggles with a stock market crash, fears over fake news and the threat of internet regulation, Microsoft's past failures have paved the way for the company's renaissance.