I recently installed Visual Studio Code and as soon as I try to run a terminal window I get this error
The terminal process command 'C:\WINDOWS\System32\cmd.exe' failed to launch (exit code: 2)
This also happens for PowerShell terminals
I have read many forums where this is asked and try the "solutions" mentioned there but none of that work.
2 Answers 2
In my case the issue was with the antivirus since it doesn ́t allow a process (Visual Studio Code) to create/spawn a new process like the command prompt (Terminal)
To solve it make sure you configure your antivirus to exclude Visual Studio Code or stop all of the antivirus services --at you own risk--
To stop the Symantec Endpoint Protection use the following sequence of commands in a .bat file
cd C:\Program Files (x86)\Symantec\Symantec Endpoint Protection
smc.exe -stop
pause
Check if the machine has enough free memory. I had the same issue and it went away after closing some unnecessary application.