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

When compiling with Spence Konde's ATtiny85 (version 1.2.2) (Arduino IDE 1.8.2) I get this error:
exec: "cmd": executable file not found in %PATH%

Windows 7 64bit.

Same program on different computer with exactly same setup for Arduino, versions, etc. compiles ok.

I had done some Arduino as ISP testing, had upgraded Spence Konde to 1.2.3, detected this error, went back to 1.2.2 but still same issue. This morning all still compiled and worked ok, "all of a sudden" now not anymore?

All compiles well until the very last line:

Linking everything together...
"C:\Users\Mysafety\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\5.4.0-atmel3.6.1-arduino2/bin/avr-gcc"  -Os  -Wl,--gc-sections -mmcu=attiny85  -o "C:\Users\Mysafety\AppData\Local\Temp\arduino_build_21574/ATtiny_Analog_Write.ino.elf" "C:\Users\Mysafety\AppData\Local\Temp\arduino_build_21574\sketch\ATtiny_Analog_Write.ino.cpp.o" "C:\Users\Mysafety\AppData\Local\Temp\arduino_build_21574/core\core.a" "-LC:\Users\Mysafety\AppData\Local\Temp\arduino_build_21574" -lm
"C:\Users\Mysafety\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\5.4.0-atmel3.6.1-arduino2/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0  "C:\Users\Mysafety\AppData\Local\Temp\arduino_build_21574/ATtiny_Analog_Write.ino.elf" "C:\Users\Mysafety\AppData\Local\Temp\arduino_build_21574/ATtiny_Analog_Write.ino.eep"
"C:\Users\Mysafety\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\5.4.0-atmel3.6.1-arduino2/bin/avr-objcopy" -O ihex -R .eeprom  "C:\Users\Mysafety\AppData\Local\Temp\arduino_build_21574/ATtiny_Analog_Write.ino.elf" "C:\Users\Mysafety\AppData\Local\Temp\arduino_build_21574/ATtiny_Analog_Write.ino.hex"
cmd /C "C:\Users\Mysafety\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\5.4.0-atmel3.6.1-arduino2/bin/avr-objdump" --disassemble --source --line-numbers --demangle --section=.text "C:\Users\Mysafety\AppData\Local\Temp\arduino_build_21574/ATtiny_Analog_Write.ino.elf" > "C:\Users\Mysafety\AppData\Local\Temp\arduino_build_21574/ATtiny_Analog_Write.ino.lst"
exec: "cmd": executable file not found in %PATH%
Fout bij het compileren van board ATtiny25/45/85

Compiling with Digistump board is ok, compiling for damellis attiny core (ATtiny microcontrollers ATtiny25/45/85) also compiles ok.

When I change in the platform.txt file for c:/Users/Mysafety/AppData/Local/Arduino15/packages/ATTinyCore/hardware/avr/1.2.2/platform.txt

the following text:

## Save disassembler listing
recipe.hooks.objcopy.postobjcopy.1.pattern.windows=cmd /C "{compiler.path}{compiler.objdump.cmd}" {compiler.objdump.flags} "{build.path}/{build.project_name}.elf" > "{build.path}/{build.project_name}.lst"
recipe.hooks.objcopy.postobjcopy.1.pattern.linux=chmod +x "{runtime.platform.path}/create_disassembler_listing.sh"
recipe.hooks.objcopy.postobjcopy.1.pattern.macosx=chmod +x "{runtime.platform.path}/create_disassembler_listing.sh"
recipe.hooks.objcopy.postobjcopy.2.pattern.linux="{runtime.platform.path}/create_disassembler_listing.sh" "{compiler.path}{compiler.objdump.cmd}" "{compiler.objdump.flags}" "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.lst"
recipe.hooks.objcopy.postobjcopy.2.pattern.macosx="{runtime.platform.path}/create_disassembler_listing.sh" "{compiler.path}{compiler.objdump.cmd}" "{compiler.objdump.flags}" "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.lst"

to:

## Save disassembler listing
##recipe.hooks.objcopy.postobjcopy.1.pattern.windows=cmd /C "{compiler.path}{compiler.objdump.cmd}" {compiler.objdump.flags} "{build.path}/{build.project_name}.elf" > "{build.path}/{build.project_name}.lst"
recipe.hooks.objcopy.postobjcopy.1.pattern.linux=chmod +x "{runtime.platform.path}/create_disassembler_listing.sh"
recipe.hooks.objcopy.postobjcopy.1.pattern.macosx=chmod +x "{runtime.platform.path}/create_disassembler_listing.sh"
recipe.hooks.objcopy.postobjcopy.2.pattern.linux="{runtime.platform.path}/create_disassembler_listing.sh" "{compiler.path}{compiler.objdump.cmd}" "{compiler.objdump.flags}" "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.lst"
recipe.hooks.objcopy.postobjcopy.2.pattern.macosx="{runtime.platform.path}/create_disassembler_listing.sh" "{compiler.path}{compiler.objdump.cmd}" "{compiler.objdump.flags}" "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.lst"

..then this problem disappears.

However,

  1. what are the consequences?

  2. why would this issue appear on this pc, and not on the exactly same other pc (probably trivial question)?

  3. is there any way to resolve the core of this problem?

  1. That will disable the added feature in 1.2.2 that allows dumping the assembler listing (we had to call cmd for some reason to make it work due to problems with directly using exec, I think exec wasn't handling the paths we passed to it correctly.

  2. Why is cmd not available on your computer? That is bizarre. Either something is wrong with your PATH environment variable (which should break a lot of things), or someone has specifically tried to make it hard to get a command prompt on your computer (either organizational security people trying to lock it down, or malware trying to make itself hard to remove). Is there a file named cmd (cmd.exe if extensions enabled) located in C:/Windows/System32 ? If yes, that implies problem with path, if not, implies that cmd.exe has been removed.

  3. I'm not sure if there's some way that we can make it ignore a failure there - but I think this is a system-level problem on the machine.

DrAzzy:

  1. That will disable the added feature in 1.2.2 that allows dumping the assembler listing (we had to call cmd for some reason to make it work due to problems with directly using exec, I think exec wasn't handling the paths we passed to it correctly.

DrAzzy:
2. Why is cmd not available on your computer? That is bizarre - is it like, a locked down school computer or something? Either something is wrong with your PATH environment variable (which should break a lot of things), or someone has specifically tried to make it hard to get a command prompt on your computer (either organizational security people trying to lock it down, or malware trying to make itself hard to remove).

No, this is my private computer, no restrictions, just login password.
When I enter cmd in the command prompt window a window c:\Windows\system32\cmd.exe appears

Today nothing special has been done with this computer except that I used Arduino as ISP on an ATtiny85, used AVRDUDESS, did some HV fuse programming, and that is about it..

How can I check/correct the PATH environment?
Restart computer? Other things?

DrAzzy:
3. I'm not sure what to do here - the assembler listing feature is very powerful, and was requested by multiple people; I don't want to remove it. I'm not sure if there's some way that we can make it ignore a failure there - but I also am not suspicious that this is a system level problem on the machine that has only been noticed now.

Yes I read up on that, I would not want to miss that.

This is bizarre! I don't know what to say at this point...

In computer properties/advanced/environment variables/systemvariables/Path the contents are as follows:

  1. on the "good" pc:
C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\DTS\Binn\;C:\PROGRA~2\PICC;C:\Program Files (x86)\ZyXEL PLA Series Utility\ZyXEL PLA Series Utility\cml;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\
  1. on the "problem" pc:
C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\WinAVR-20100110\bin;C:\Program Files (x86)\WinAVR-20100110\utils\bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\OpenSSH\bin;C:\Program Files (x86)\Microchip\xc8\v1.38\bin;C:\PROGRA~2\PICC;C:\Program Files\PuTTY\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Python 2.7.9\;C:\Program Files (x86)\QuickTime\QTSystem\

I can't see any significant difference.

This is what's missing from the problem one - and %SystemRoot%\System32 is where cmd lives.

%SystemRoot%\system32;%SystemRoot%;

DrAzzy:
This is what's missing from the problem one - and %SystemRoot%\System32 is where cmd lives.

%SystemRoot%\system32;%SystemRoot%;

Oh, great! Thanks a lot! Problem solved!

Much appreciated.