Here are the instructions:
Start up in Single-User mode by holding down the command (Apple) key and the 's' key while you press the power switch. You can let go the keys when you see white text on a black background. When this has finished you will see a prompt ending in '#', although there may be other messages. Type: /sbin/fsck -fy followed by a return, at the prompt and wait a few seconds for 8-10 lines of output. If the last line says repairs were carried out, repeat this command until you get a message 'The volume appears to be OK'. Then continue with
/sbin/mount -uw /
cd /Library/Preferences
rm com.apple.loginwindow.plist
rm com.apple.windowserver.plist
cd /Library/Caches
rm -r *
cd /System/Library
rm Extensions.kextcache
cd /System/Library/Caches
rm -r *
reboot