A good virus scanner will stop most nonsense like this, though there is no substitute for pc-streetwise or simple caution.
My virus scanner quarantines any suspicious emails or webpages before I view them.
In fact, in all my years on pcs (since '80 or thereabouts) I have yet to contract any kind of virus or trojan. Pretty impressive, now that I think about it.