mscorsvw.exe high CPU useage

Table of Contents

After some .NET updates you may find mscorsvw.exe using up a lot of your CPU.
David goes into more detail why this happens on his blog here – http://blogs.msdn.com/b/davidnotario/archive/2005/04/27/412838.aspx

But here is my copy and paste solution.
Let this complete and mscorsvw.exe should go away!

cd /d "C:\Windows\Microsoft.NET\Framework\v4.0.30319"
ngen.exe executequeueditems

if %PROCESSOR_ARCHITECTURE%==AMD64 (
  cd /d "C:\Windows\Microsoft.NET\Framework64\v4.0.30319"
  ngen.exe executequeueditems
)