Using Windows EXE file format in operating system
<p>I know that adding Windows .exe file format can be very very hard. I want my OS to run .exe files and I'd like to know if I can use them freely in my OS without any risk or if I have to contact Microsoft for license.</p>

<p>You would essentially be creating a virtual machine that emulates the x86 achitecture (64-bit, 32-bit, 16-bit as many as you want/need), and possibly implementing your own .net runtime as well. This is perfectly legal to do and has been done (see examples WINE and MONO for linux).</p>

<p>Where you may run into legal issues is when executing EXE files that are owned by someone else. You would have to read the software license agreement and user6726's answer covers this in the Microsoft case. It is highly unlikely that Microsoft comes after you for doing this on your own machine, including friends and family. Lawyers simply cost too much.</p>

<p>Where you will definitely run into legal problems is if you start selling/distribute Microsoft's EXEs with your OS to the public. The more successful you become, the more certain it is that it is worth their while to sue you. If you want to do this you should definitely obtain permission from Microsoft, as well as any other third party software owners, whose files you wish to include with your OS.</p>

copyright software licensing