Here’s a reinstall asp.net script:
This example is for asp.net 4.0 on a 64 bit system, it stops IIS, uninstalls all versions of asp.net, reinstalls asp.net, then starts IIS:
NET STOP IISADMIN /Y
"C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe" -ua
"C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe" -i
NET START IISADMIN /Y
pause