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

how to avoid that %PATH% error messsage...

I have env variable C:/Program Files(x86)/arduino but it still don't work ...

My arduino.exe file is in that directory C:/Program Files(x86)/arduino but it not work ?

Can you help me please ?

best regards -arto-

1 Like

Please do this:

  • When you encounter an error, you'll see a button on the right side of the orange bar "Copy error messages" in the Arduino IDE (or the icon that looks like two pieces of paper at the top right corner of the black console window in the Arduino Web Editor). Click that button..
  • In a forum reply here, click on the reply field.
  • Click the </> button on the forum toolbar. This will add the forum's code tags markup to your reply.
  • Press "Ctrl + V". This will paste the error between the code tags.
  • Move the cursor outside of the code tags before you add any additional text to your reply.

If the text exceeds the forum's 9000 character limit, save it to a .txt file and post it as an attachment. If you click the "Reply" button here, you will see an "Attachments and other settings" link.

Arduino: 1.8.11 (Windows 10), Board: "ESP32 Dev Module, Disabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 80MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, None"

exec: "cmd": executable file not found in %PATH%
Error compiling for board ESP32 Dev Module.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Please do this:

  • (In the Arduino IDE) click File > Preferences
  • Check the box next to "Show verbose output during: > compilation
  • Click "OK"
  • Sketch > Verify/Compile
  • After the compilation fails you'll see a button on the right side of the orange bar "Copy error messages". Click that button.
  • In a forum reply here, click on the reply field.
  • Click the </> button on the forum toolbar. This will add the forum's code tags markup to your reply.
  • Press "Ctrl + V". This will paste the compilation output between the code tags.
  • Move the cursor outside of the code tags before you add any additional text to your reply.

If the length of the output exceeds the forum's 9000 character limit, save it in a .txt file and post it here as an attachment. If you click the "Reply" button you'll see the "Attachments and other options" link.

``Arduino: 1.8.11 (Windows 10), Board: "ESP32 Dev Module, Disabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 80MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, None"

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Program Files (x86)\Arduino\hardware\espressif\esp32\libraries -fqbn=espressif:esp32:esp32:PSRAM=disabled,PartitionScheme=default,CPUFreq=80,FlashMode=qio,FlashFreq=80,FlashSize=4M,UploadSpeed=921600,DebugLevel=none -ide-version=10811 -build-path C:\Users\arto\AppData\Local\Temp\arduino_build_608696 -warnings=none -build-cache C:\Users\arto\AppData\Local\Temp\arduino_cache_564963 -prefs=build.warn_data_percentage=75 -verbose C:\Users\arto\AppData\Local\Temp\untitled1297541106.tmp\sketch_feb04a\sketch_feb04a.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Program Files (x86)\Arduino\hardware\espressif\esp32\libraries -fqbn=espressif:esp32:esp32:PSRAM=disabled,PartitionScheme=default,CPUFreq=80,FlashMode=qio,FlashFreq=80,FlashSize=4M,UploadSpeed=921600,DebugLevel=none -ide-version=10811 -build-path C:\Users\arto\AppData\Local\Temp\arduino_build_608696 -warnings=none -build-cache C:\Users\arto\AppData\Local\Temp\arduino_cache_564963 -prefs=build.warn_data_percentage=75 -verbose C:\Users\arto\AppData\Local\Temp\untitled1297541106.tmp\sketch_feb04a\sketch_feb04a.ino
Using board 'esp32' from platform in folder: C:\Program
Using core 'esp32' from platform in folder: C:\Program
cmd /c if exist "C:\Users\arto\AppData\Local\Temp\untitled1297541106.tmp\sketch_feb04a\partitions.csv" copy /y "C:\Users\arto\AppData\Local\Temp\untitled1297541106.tmp\sketch_feb04a\partitions.csv" "C:\Users\arto\AppData\Local\Temp\arduino_build_608696\partitions.csv"
exec: "cmd": executable file not found in %PATH%
Error compiling for board ESP32 Dev Module.

there is no such error message if I compile for instance to arduino uno board

artsiha:
there is no such error message if I compile for instance to arduino uno board

Yes, this is specific to the ESP32 package.

Note this is not about arduino.exe, it's about cmd not being found in %PATH%. cmd is under C:\Windows\system32. Make sure that folder is in your path.

I see you are using the development version of ESP32 core for Arduino. Note that is intended to be used only for developers and beta testers. The reason is the development version is more likely to have bugs. For normal usage, I recommend using the Boards Manager installation:
https://github.com/espressif/arduino-esp32/blob/master/docs/arduino-ide/boards_manager.md

artsiha:
today I followed this link: Getting Started with ESP-NOW (ESP32 with Arduino IDE) | Random Nerd Tutorials

That is essentially the same installation method described at the link I provided in my previous reply. The only difference is that tutorial is using an outdated Boards Manager URL:

https://dl.espressif.com/dl/package_esp32_index.json

The new official Boards Manager URL is:

https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json

The old one does work, but we have no guarantees it will continue to work, or that they will publish new releases to it.

For this reason, I recommend changing to the new URL. I'll provide instructions:

  1. Select File > Preferences from the Arduino IDE menus.
  2. Change the URL in the "Additional Boards Manager URLs" field from this:
    https://dl.espressif.com/dl/package_esp32_index.json
    
    to this:
    https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
    
  3. Click the "OK" button.

You don't need to do anything else from the instructions I provided, because you already did it all by following that tutorial.

artsiha:
and it works fine !

The reason the Boards Manager installation fixed your "exec: "cmd": executable file not found in %PATH%" error is because it installs the 1.0.4 release, which was before they started using cmd. The error will come back after they do the next release and you update to it. So if you don't want to update your path now, keep the fix I mentioned above in mind to try if the error comes back after the next update.

1 Like

You're welcome. I'm glad if I was able to be of assistance. Enjoy!
Per