Hi,
I'm Rodrigo and I'll help you.
When you start the computer, some programs use the command prompt to start some services, that's why it opens and closes abruptly. It is normal, but it is good to check the apps that start with your computer and scan for viruses.
You can see your startup apps on the Task Manager.