Generating project files fails, switching unreal versions fails

whenever i try and generate project files or switch unreal engine versions it always fails with this same error

Running C:/Program Files/Epic Games/UE_4.14/Engine/Binaries/DotNET/UnrealBuildTool.exe  -projectfiles -project="D:/Unreal/Projects/test/test.uproject" -game -engine -progress
Discovering modules, targets and source code for project...
ERROR: System.UnauthorizedAccessException: Access to the path 'C:\Program Files\Epic Games\UE_4.14\Engine\Intermediate\ProjectFiles\Timestamp' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
   at System.IO.File.Create(String path)
   at UnrealBuildTool.UnrealBuildTool.RunUBT(String[] Arguments, FileReference ProjectFile) in C:\Program Files\Epic Games\UE_4.14\Engine\Source\Programs\UnrealBuildTool\System\UnrealBuildTool.cs:line 1635

ok i fixed it by going into my c drive and finding the epic games folder then right clicking ang going to properties and security and then allowing all.

Anyone know why i have to do this to get it to work i have never had thid problem before and i am the system administrator account so i should have had full access to the files and folders without changing security permissions .

This works for me, thanks!

This may also be fixed by running “Verify” (in the launcher) on your UE4 install. In my particular case, I suspect my problem came from also dealing with a Source or Binary build of the engine.

This helped me thank you so much!