How to launch a process with CPU affinity set

I was trying to get this internet explorer process launched so that it can use only 4 processors on a 8 core machine. It wasnt as easy as I thought initially. Finally I figured out an easy way and I am sure it will save a lot of time for others who require to do this….