批处理代码随机关闭

So I just started coding yesterday. There are probably lots of problems but there is one that causes my code to randomly close when I complete a certain action. Please help, here is the section of the code that isn't working 1)https://i.stack.imgur.com/6sgI2.png

2)https://i.stack.imgur.com/FurMY.png

3)https://i.stack.imgur.com/FEUdh.png