I definitely agree with genie... it is NOT a good idea to unplug a running PC. It can CAUSE the type of problem you are having with shutdown and many others. Sudden loss of power can and does corrupt critical system files.
for your shutdown issue... we need a lot more info.
basically eveything about your computer...
operating system/brand-name of PC/amount of
RAM installed/Firewall?/Antivirus?