Microsoft Corp's quarterly profit fell, but its shares rose as investors welcomed continuing efforts to cut costs and news that the release of the Windows 7 operating system is on track.

The world's largest software company offered no profit forecast on Thursday, after withdrawing its outlook in January, but did say it expected weakness in its markets to continue through at least the next quarter.

Microsoft's report, following strong earnings from Apple Inc and other tech giants earlier this week, broadly pleased analysts, some of whom were braced for worse.

It's good to see that they are controlling their costs because that's within their sphere of control. They can't really do a lot about demand, said Kim Caughey at money manager Fort Pitt Capital Group.

They have a nice product refresh cycle coming up which should allow them to maintain their market share, she added, referring to the new Windows 7.

Microsoft said it was targeting $26.7 billion to $26.9 billion in operating expenses for the fiscal year, which ends June 30. That is below the $27.4 billion target three months ago.

In January it said it would slash up to 5,000 jobs, or just over 5 percent of its 96,000 staff, over 18 months, in a bid to save $1.5 billion a year. It cut 1,400 staff right away.

The company, which released the beta test version of its new Windows 7 operating system during the quarter, said the system was on track for a fiscal 2010 launch, which would mean before July next year.

Most in the industry expect it to deliver well before that, as Microsoft tries to put the unpopular Vista operating system behind it.

Microsoft, based in Redmond, Washington, reported fiscal third-quarter profit of $2.98 billion, or 33 cents per share, compared with $4.39 billion, or 47 cents per share, in the year-ago quarter.

Excluding costs of the recent layoffs and charges for impaired investments, Microsoft reported profit of 39 cents per share. That met analysts' average estimate, according to Reuters Estimates.

Sales fell 6 percent to $13.65 billion, marking the first year-on-year decline in quarterly revenue in Microsoft's 34-year history. Analysts were expecting $14.1 billion, on average.

The company's shares rose 4 percent in after-hours trading, after closing at $18.92 on Nasdaq.

(Reporting by Bill Rigby; Editing by Richard Chang)