To check if a particular program is slowing the machine when you switch on or shut down, e.g. an antivirus program, go to Control Panel > All Control Panel Items > Performance Information and Tools > Advanced Tools (in the left pane). On this screen the problem is sometimes shown. If not, click View Performance Details in Event Log (Event Viewer). Events in the 100 series are boot events and I believe those in the 200 series are shut down events. These can be followed up by double-clicking them, then clicking Event Log Online at the bottom.
In XP and Vista, Microsoft’s Process Explorer is a boon. I haven‘t tried it in Win7 but I see no reason why it shouldn‘t work. There is an explanation and a link to Microsoft’s site here http://www.pcmag.com/article2/0,1895,2092881,00.asp