SOLVED: exec: "cmd": executable file not found in %PATH%

Hi @Edin_Fific. Thanks for taking the time to share the solution you found!

I don't think it is a problem in Arduino IDE. Instead it is a deficiency with your Windows configuration.

The ESP32 boards platform uses the Windows command processor (cmd.exe) during the compilation process. It is assumed that you have the path to cmd.exe in your system Path environment variable, as is standard.

This error indicates that you have some unusual configuration of Windows that causes the path to cmd.exe to not be in your system Path environment variable. You can fix the problem by adding that path to the environment variable. The most significant benefit to my solution is that it will persist through Arduino IDE updates. I also fear that your solution might not work in the case where Arduino IDE is started from another folder (which might occur if you start Arduino IDE by opening a .ino file via file association instead of by launching the IDE directly?).

I'll provide instructions for my solution:

  1. Right click the "Start" icon on the left side of the Windows taskbar
  2. Select "System" from the menu.
    The "Settings" window will open.
  3. Click the "Advanced system settings" link you find under the "Related Links" (or "Related Settings" if you are using Windows 10) section of the "Settings" window.
  4. If you get a "User Account Control" dialog, click the Yes button.
  5. In the "System Properties" window, select the "Advanced" tab.
  6. Click the Environment Variables button.
    An "Environment Variables" dialog will open.
  7. Select the "Path" variable from under the "System variables" section of the dialog "Environment Variables" dialog.
    An "Edit environment variable" dialog will open.
  8. Click the New button in the "Edit environment variable" dialog.
  9. Type %SystemRoot%\system32
  10. Click the OK button in the "Edit environment variable" dialog.
  11. Click the OK button in the "Environment Variables" dialog.
  12. Restart Arduino IDE if it is running.

Now try compiling or uploading to your ESP32 board again. Hopefully the error will no longer occur.


Please let me know if you have any questions or problems while following those instructions.

4 Likes