WPILIB build error - Path to shell executable "cmd.exe" does not exist

So I have installed a fresh installation of WPILIB on my personal home computer, and started working on a standard template project, when I realized I could not build the code. I have installed the swerve-lib, PathPlannerLib, and CTRE-Phoenix vendor libraries. I did have another existing version of visual studio code installed before installing WPILIB. I tried setting the default profile shell to command line, tried installing the JDK again, reinstalled WPILIB, and running the gradle build from an external command line. However I keep getting the same error

Executing task: gradlew build -Dorg.gradle.java.home=“C:\Users\Public\wpilib\2022\jdk” <

The terminal process failed to launch: Path to shell executable “cmd.exe” does not exist.

I am aware there is already a topic about this error, but it has closed without an explanation for the solution

[The usual location for “cmd.exe” is normally something like: C:\Windows\System32.]

1 Like

Thank you so much! This solved my problem

1 Like