Hello vishwanth,
I had exact same problem - I've upgraded from windows 8.1 to windows 10, then downloaded omnet 5.0.
What've leaded to error:
>Unpacking package of omnet5.0
>running mingwenv
>>then, mingenv prompted about missing mingw and installed it correctly.
After then, i've received message, which says "could not detach from caller".
I've tried to install cygwin, rebooting, reinstalling - it doesnt helped.
What i did, and resulted in successfully running omnet:
>uninstalled cygwin
>deleted decompressed omnet5.0 folder with all within
>rebooted
>setting "never notify" in control pane -> users -> change user account control settings
>decompressed zipped omnet5.0 again
> !!! MOVED IT!!! to partition, where I have installed my windows OS (for me, it was C:/, so after moving, omnet was in C:/omnet)
> Right clicked mingwenv, selected "run it as Administrator"
and it worked ;)
Be sure that your omnet localization has no whitespaces in name, i had issue with it few months ago.
Let me know if it worked for you :)
Probably some of these steps arent essential for getting it done, but... I'm not brave enough to check it by myself, I've forced omnet to cooperate, and I'm done with research :D
Thanks
Lukasz