I'm sure that there are Visual Basic or .net scripts out there to automate this, but I only know how to do it manually - go to the stock you want at finance.yahoo.com, then click on "historical data" on the left.
Once you have the date range you want, there is a small link to "download to...