Most of the pain comes from the fact that support for command line (and even things like concept of current directory) is bolted onto the win16 inspired win32 API as a complete afterthought.
Things that are implemented as command line utilities or call such commandline utilities (which includes Visual Studio and Windows SDK!) tend to cause these cludges to become painfully apparent.