I am able to login to my windows 8.1 machine but as soon as Desktop appears I get memory errors from taskhostex.exe
After I cancel it a series of errors come up one by one, new one comes after I cancel the first one, and if I press ok anywhere, the system restarts. following is screenshot of one of those errors.
UPDATE
as I am not able to interact with my pc due to this error I tried to make a bootable usb of Ubuntu and then select "try Ubuntu" option so that I can atleast recover my data on hard disk. I am not able to open any disk drive in Ubuntu because my windows hasn't been shutdown properly yet, then I tried to shut it down from the lockscreen , and its taking forever to shutdown or restart, but it isn't completing.
UPDATE 2 I made a windows 8.1 bootable usb and tried to repair pc with it, it says:
The drive where windows is installed is locked. Unlock the drive and try again.
and when I try to upgrade my existing windows 8.1 installation, it asks for the key and after that it says to restart and run windows normally and then upgrade. I cant even get into my windows how can I upgrade from there? :/

