IDE on Windows can't verify or upload -- avr-g++ file does not exist

Hello all,

I have been facing this problem on my Windows 10 PC, where I have installed Arduino 1.8.1 IDE, but I am unable to verify or upload any code, even the default blank sketch or blink.

I've scanned the forums and performed clean reinstalls (deleting user AppData & temp folders) to no luck in figuring it out. I have also tried installing different versions of AVR Boards from Board Manager.

I keep getting the following error:

exec: "C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++": file does not exist
Error compiling for board Arduino/Genuino Uno.

The full error log is:

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:\Users\BBBBB BBBBB\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10801 -build-path C:\Users\BBBBBB~1\AppData\Local\Temp\arduino_build_655279 -warnings=none -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\BBBBBB~1\AppData\Local\Temp\untitled1261735251.tmp\sketch_feb25a\sketch_feb25a.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:\Users\BBBBB BBBB\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10801 -build-path C:\Users\BBBBBB~1\AppData\Local\Temp\arduino_build_655279 -warnings=none -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\BBBBBB~1\AppData\Local\Temp\untitled1261735251.tmp\sketch_feb25a\sketch_feb25a.ino
Using board 'uno' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Using core 'arduino' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
Detecting libraries used...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10801 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\BBBBBB~1\AppData\Local\Temp\arduino_build_655279\sketch\sketch_feb25a.ino.cpp" -o "nul"
Generating function prototypes...
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10801 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\BBBBBB~1\AppData\Local\Temp\arduino_build_655279\sketch\sketch_feb25a.ino.cpp" -o "C:\Users\BBBBBB~1\AppData\Local\Temp\arduino_build_655279\preproc\ctags_target_for_gcc_minus_e.cpp"
exec: "C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++": file does not exist
Error compiling for board Arduino/Genuino Uno.

I'm not sure if this is a Java issue or something. I have tried installing a previously saved version from another computer (1.6.12) and it gives me the same error. Perhaps the path in the back/forward-slashes are not being parsed properly?

I'm lost right now. Any help would be greatly appreciated.

Edit: To add on to this, I added more Windows users and it appeared to work in those users. Tried with short and long username and both worked.

Figured it out. To answer my own question, the culprit was my own custom environment on the user profile ("PATHEXT" = ".PY") so that I can shorthand some of my own scripts on the command line. I removed this and the IDE now works properly!

you change arduino's home directory to the root directory, long folder names causes this error

Peabrain46:
Figured it out. To answer my own question, the culprit was my own custom environment on the user profile ("PATHEXT" = ".PY") so that I can shorthand some of my own scripts on the command line. I removed this and the IDE now works properly!

Dude, I don't know how you've figured this out but you are a savior.

I tried every suggested step with "delete AppData/Local/Arduino15 and reinstall", "delete AppData/Local/Temp and reinstall" and none did help.

Your advice worked like a charm!

The only difference is that my "PATHEXT" was set to ".BAT", which means ArduinoIDE somehow conflicts with it when set.

Thumbs up.