How to fix "-waitmutex exited with code 5Please verify that you have sufficient rights to run this command" error?

Hi I am trying to build just one of the basic start templates (C++ Top-Down) in UE4. The solution will only build about 40% of the time (after a full Rebuild) the rest of the time I get:

“AITEditor Win64 Development “C:\AIT\AIT.uproject” -waitmutex” exited with code 5. Please verify that you have sufficient rights to run this command."

I have not added/removed any code or game objects at this point, this has happened with every single project I have created both at my Office and at Home.

The “sufficient rights” led me to believe it was a User Profile issue but I am an administrator on both of these machines, unless it’s trying to run Build.bat with some other profile? But then why would it be such an intermittent issue?

Could anybody provide any insight? I was hoping to use UE4 to create some AI Examples for my students next year but if I can’t get the basics working that won’t be an option.

Many thanks,
Will

Details

Platform: Windows 10
UE4 Version: 4.16.1
Visual Studio: VS Community 2015 14.0.25431.01 Update 3

Console

1>------ Build started: Project: UE4, Configuration: BuiltWithUnrealBuildTool Win32 ------
2>------ Build started: Project: AIT, Configuration: Development_Editor x64 ------
2> Compiling game modules for hot reload
2> Parsing headers for AITEditor
2> Running UnrealHeaderTool “C:\AIT\AIT.uproject” “C:\AIT\Intermediate\Build\Win64\AITEditor\Development\AITEditor.uhtmanifest” -LogCmds=“loginit warning, logexit warning, logdatabase error” -Unattended -WarningsAsErrors -installed
2> Reflection code generated for AITEditor in 5.7266943 seconds
2> Performing 6 actions (4 in parallel)
2> AITPlayerController.cpp
2> AITGameMode.cpp
2> AITCharacter.cpp
2> AIT.generated.cpp
2> [5/6] Link UE4Editor-AIT-5828.dll
2> [6/6] Link UE4Editor-AIT-1339.lib
2> Creating library C:\AIT\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-AIT-5828.lib and object C:\AIT\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-AIT-5828.exp
2> Creating library C:\AIT\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-AIT-5828.suppressed.lib and object C:\AIT\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-AIT-5828.suppressed.exp
2>ERROR : UBT error : Failed to produce item: C:\AIT\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-AIT-1339.lib
2> Total build time: 9.32 seconds (Local executor: 0.00 seconds)
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(41,5): error MSB3075: The command ““C:\Program Files\Epic Games\UE_4.16\Engine\Build\BatchFiles\Build.bat” AITEditor Win64 Development “C:\AIT\AIT.uproject” -waitmutex” exited with code 5. Please verify that you have sufficient rights to run this command.
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Hi Nachtmahr, thanks for your response. I changed Compatability Settings for Visual Studio to always “Run As Administrator”.

There is no game running for certain, and while I appreciate the suggestion about deleting the Intermediate folder this is happening literally every few minutes. It would not be feasible for me to delete the folder every time this happens.

It’s looking like I may have to scrap UE4 and just write all my stuff from scratch :frowning:

Run Visual Studio as Admin, make sure you don´t have a Game Started inside the Editor.

You can also try to delete your Intermediate folder