Windows 10, McAfee, ESP8266: file... being used by another process

I just migrated to a new laptop, from a 2-year-old Toshiba to a new Dell XPS 15 with SSD, and the Arduino ESP8266 compilations fail due to a conflict with my virus scanner (McAfee).

I would love to Exclude the Arduino temporary compilation folder from the virus scan, but Arduino IDE chooses a new name every time it is restarted.

Any suggestions other than disabling my virus scanner or excluding the entire AppData\Local\Temp folder?

Details:
Windows 10 Home.
16GB Ram
512 GB SSD (the previous laptop, which happily compiled Arduino ESP8266 Sketches, had a spinning disk).
Intel Core i7-7700HQ CPU @2.80 GHz 2.80 GHz
Arduino IDE 1.8.5
esp8266 by ESP8266 Community version 2.3.0 installed

The symptom: I start Arduino IDE, select Board: Sparkfun ESP8266 Thing Dev (I've installed the ESP8266 support), open the Blink Sketch and compile. The compilation fails.
If I disable McAfee virus scanning before I compile, the compilation succeeds.
If I select Board: Arduino/Genuino Uno, the compilation succeeds, regardless of the state of virus scanning.

I realize that this seems to be an ESP8266-specific problem, but because the issue happens in the Arduino ctags app, I thought I'd try for an answer in this forum before going to the ESP8266 Community forum.

The compiler verbose output follows:

Arduino: 1.8.5 (Windows 10), Board: "SparkFun ESP8266 Thing Dev, 80 MHz, 115200"

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\Brad\AppData\Local\Arduino15\packages -hardware C:\Users\Brad\Documents\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\Brad\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Brad\Documents\Arduino\libraries -fqbn=esp8266:esp8266:thingdev:CpuFrequency=80,UploadSpeed=115200 -ide-version=10805 -build-path C:\Users\Brad\AppData\Local\Temp\arduino_build_86713 -warnings=none -build-cache C:\Users\Brad\AppData\Local\Temp\arduino_cache_285868 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.esptool.path=C:\Users\Brad\AppData\Local\Arduino15\packages\esp8266\tools\esptool\0.4.9 -prefs=runtime.tools.xtensa-lx106-elf-gcc.path=C:\Users\Brad\AppData\Local\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2 -prefs=runtime.tools.mkspiffs.path=C:\Users\Brad\AppData\Local\Arduino15\packages\esp8266\tools\mkspiffs\0.1.2 -verbose C:\Program Files (x86)\Arduino\examples\01.Basics\Blink\Blink.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\Brad\AppData\Local\Arduino15\packages -hardware C:\Users\Brad\Documents\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\Brad\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Brad\Documents\Arduino\libraries -fqbn=esp8266:esp8266:thingdev:CpuFrequency=80,UploadSpeed=115200 -ide-version=10805 -build-path C:\Users\Brad\AppData\Local\Temp\arduino_build_86713 -warnings=none -build-cache C:\Users\Brad\AppData\Local\Temp\arduino_cache_285868 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.esptool.path=C:\Users\Brad\AppData\Local\Arduino15\packages\esp8266\tools\esptool\0.4.9 -prefs=runtime.tools.xtensa-lx106-elf-gcc.path=C:\Users\Brad\AppData\Local\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2 -prefs=runtime.tools.mkspiffs.path=C:\Users\Brad\AppData\Local\Arduino15\packages\esp8266\tools\mkspiffs\0.1.2 -verbose C:\Program Files (x86)\Arduino\examples\01.Basics\Blink\Blink.ino
Using board 'thingdev' from platform in folder: C:\Users\Brad\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0
Using core 'esp8266' from platform in folder: C:\Users\Brad\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0
Build options changed, rebuilding all
Detecting libraries used...
"C:\Users\Brad\AppData\Local\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-IC:\Users\Brad\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/include" "-IC:\Users\Brad\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/lwip/include" "-IC:\Users\Brad\AppData\Local\Temp\arduino_build_86713/core" -c -w -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -ffunction-sections -fdata-sections -w -x c++ -E -CC -DF_CPU=80000000L -DLWIP_OPEN_SRC -DARDUINO=10805 -DARDUINO_ESP8266_THING_DEV -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD="ESP8266_THING_DEV" -DESP8266 "-IC:\Users\Brad\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266" "-IC:\Users\Brad\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\variants\thing" "C:\Users\Brad\AppData\Local\Temp\arduino_build_86713\sketch\Blink.ino.cpp" -o "nul"
Generating function prototypes...
"C:\Users\Brad\AppData\Local\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-IC:\Users\Brad\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/include" "-IC:\Users\Brad\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0/tools/sdk/lwip/include" "-IC:\Users\Brad\AppData\Local\Temp\arduino_build_86713/core" -c -w -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -ffunction-sections -fdata-sections -w -x c++ -E -CC -DF_CPU=80000000L -DLWIP_OPEN_SRC -DARDUINO=10805 -DARDUINO_ESP8266_THING_DEV -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD="ESP8266_THING_DEV" -DESP8266 "-IC:\Users\Brad\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266" "-IC:\Users\Brad\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\variants\thing" "C:\Users\Brad\AppData\Local\Temp\arduino_build_86713\sketch\Blink.ino.cpp" -o "C:\Users\Brad\AppData\Local\Temp\arduino_build_86713\preproc\ctags_target_for_gcc_minus_e.cpp"
"C:\Program Files (x86)\Arduino\tools-builder\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\Brad\AppData\Local\Temp\arduino_build_86713\preproc\ctags_target_for_gcc_minus_e.cpp"
open C:\Users\Brad\AppData\Local\Temp\arduino_build_86713\sketch\Blink.ino.cpp: The process cannot access the file because it is being used by another process.
Error compiling for board SparkFun ESP8266 Thing Dev.

Try to change the path where arduino stores the files and exclude that from mcAfee instead of your whole %temp% folder.

McAfee has the ability to exclude a "directory"and that is the method you should use.
That would let the contents change eg. file names. However do not include temporary folders that windows uses.

noelvissers: I found a page about setting the temporary folder, at https://www.kanda.com/blog/microcontrollers/avr-microcontrollers/find-arduino-hex-files-output-binaries/

That post suggests editing the Arduino preferences.txt file and adding a build.path variable.

I tried that. I found that my initial change to the build.path (to a folder under Documents) caused even Arduino Uno builds to fail with unresolved references to Main. Fortunately, setting build.path to C:\Users\Me\AppData\Local\Temp\arduino avoided that problem.

Now all I have to do is find how to convince my Home (not Enterprise) McAfee to exclude a folder rather than a file.

Thanks for the hint,
Brad

ballscrewbob: Thanks for the pointer. If I were running McAfee Virus Scan Enterprise, it sounds like that should fix the problem. Unfortunately, I haven't yet found a way to tell McAfee AntiVirus Plus version to exclude a folder - it seems to understand only how to exclude files (one by one).

Interestingly, even though the error message in my initial question is about a temporary .cpp file, excluding that specific file didn't solve the problem. So I need to do a little more research to find whether a) there's a way for me to exclude a folder in McAfee AntiVirus Plus, and b) whether I can work around the problem by excluding specific files other than the .cpp file.

Thanks again,
Brad

Almost all the other AV programs will let you exclude folders too but McAfee is a PITA for that aspect.

Not used that or Norton for many years as they are in my "bloatware" list.