Hello,
If the command prompt of your PC keeps on crashing, this means that the software is damaged. For us to assist you, we recommend that you perform a repair upgrade. This will repair all Windows 10 built-in applications that are having issues and all your personal files and settings won't be affected.
Let us know how it goes and if you need further assistance, feel free to post back.
If you think this was useful, do not hesitate to "mark it as an answer" to help those who are facing the same problem.