New answers tagged prerequisites
As mentioned by @jubblerbug, this can occur if you already have .NET Framework 4.6 installed before SharePoint 2013 (e.g. if you installed Visual Studio 2015 first). I couldn't use Microsoft's workaround as the option to remove .NET Framework 4.5 was disabled, and the ability to uninstall the .NET 4.6 update wasn't there either. So I used Process Monitor to ...
In my case, I have downloaded the installer script from the Net, after removing one by one arguments from the script I found that there is an unknown character in AppFabric file name! typing the file name (including file extension) again and running the script solved the issue!
The solution to this problem: In Windows Server2012 R2 ServerManagerCMD.exe does not exist, but the setup needs it. I made a copy of C:\Windows\system32\ServerManagerCmd.exe and renamed it to ServerManagerCMD.exe. After this 'fix' all prerequisites are successfully installed.
You also need .NET Framework 3.5 installed. Check under features that its available. If not, follow the guide How to install .NET Framework 3.5 on Windows Server 2012 and Windows Server 2012 R2
Top 50 recent answers are included