For anyone is still looking for the solution: "Couldn't set association for project. Check the file is writeable" when trying to generate project files - #5 by quano1
“C:/Program Files/Epic Games/UE_5.1/Engine/Build/BatchFiles/Build.bat” -projectfiles -project=“D:/Unreal Projects/MyProject/MyProject.uproject” -game -rocket -progress