Try to get a look at the ">" when the windows open: Is it a "system32" path or perhaps a "PS>" prompt. If the latter thenPowershell is being launched by something.
Take a look at keyboard shortcuts that may have been created for games, Ease of access, Personalization. and Gaming. Could be that a shortcut is not as it should be - if it should be there at all.
I will add some other suggestions:
1) Run the built in Windows troubleshooters - the troubleshooters may find and fix that unknown "something".
2) Try "sfc /scannnow" and "dism" via the Command Prompt.
References:
https://www.lifewire.com/how-to-use-sfc-scannow-to-repair-windows-system-files-2626161
https://www.windowscentral.com/how-use-dism-command-line-utility-repair-windows-10-image
Failing a "Windows' fix" then you can delve deeper:
Look in Task Manager > Startup for any unidentified/unrecognized apps being launched at startup. Do not immediately delete anything - instead try to identify what it is and what it is supposed to do.
A second place to look is Task Scheduler. There may be some trigger in place that opens the Command Prompt (?) Window. Perhaps deliberately or just due to some bad or corrupted code. It will take some time to read through Task Scheduler but you may realize while looking that there is some cause and effect relationship occurring.
You can also download Process Explorer (free) via Microsoft's website. Again once you can view all of the running processes then you again may see something that appears out of order or otherwise does not make sense. Do not react by immediately disabling or deleting anything. Research whatever you see that causes concern.
Take you time and keep notes.
Lastly: Ensure that all important data is backed up at least 2 x and proven to be recoverable and readable. Store copies off of the computer in question.