Windows 7 SFC Errors in Recovery Console CLI

So I decided to fire up the desktop machine today and it went straight into a blue screen,  its running Windows 7 so I decided to reboot and load up the Recovery Console by pressing F8 as the PC was loading to try and run the system file checker (SFC).

What happened next was a little odd and looking around the net it isn’t particularly well documented, its out there in bits and bobs but I thought it might be helpful to tie it all together in one place.

So the scenario here is that I’ve loaded the recovery console and chosen to go into the command line, my end game is that I want to run the SFC.

So your first step might be to run;

X:\sfc /SCANNOW

If you’re hitting the same issues as me there are two things you should notice at this point, firstly that the command prompt is set to some random hard drive letter. Secondly that it throws this error when you try to run that command;

There is a system repair pending which requires reboot to complete. Restart windows and run SFC again

In my case its because the X drive is just where the recovery partition has been mounted, obviously its not the boot partition. Next you might try the following command;

X:\sfc /SCANNOW /OFFBOOTDIR=C:\ /OFFWINDIR=C:\Windows

It seems reasonable to assume that this would force SFC to run on the C drive, however you may get this error;

Windows Resource Protection could not start the repair service

Well, thats actually because you’re assuming that the recovery console has mounted the boot drive onto the same drive letter that you normally use, in fact its probably put it somewhere else, to find out you can just run the next command.

X:\bcdedit | find "osdevice"

Nice and simple, this will return where the OS is installed, in my case it returned the following.

osdevice            partition=E:

So now I know where my partition is hiding I can re-run the SFC command above with the correct detail and this time you should find it runs successfully 🙂 Hope this helps someone!

x:\sfc /SCANNOW /OFFBOOTDIR=E:\ /OFFWINDIR=E:\Windows

Read More

Remove and manage WordPress Comments Spam

So I’ve been a bit lax at approving comments lately, but in my defense there were 3500 of them… in fact it turns out that only about 8-9 of them weren’t actually spam! So how did I finally deal with this?

It definitely wasn’t by using the bulk actions on 20 comments at a time. Instead I activated the Akismet plugin which has been hanging around my install for a while, albeit disabled.

Before you can get started you need to grab an API key from their site but its free for personal/non commercial use (double check the terms and conditions on the site though, don’t take my word for it 🙂 )

Now the one thing that it doesn’t do is handle all your old comments automatically, but don’t fret! It can still go back over your old comments and clear out the spam. To do this you just load up your admin page, head over to the Comments tab on the left and at the top you will find a button, “Check for Spam”. If you press this the page will stay the same but the browser loading image will start to move. Word of warning, on my server with over 3500 comments to look through it took about 10-15minutes and that was spent entirely sat on the same page with absolutely no indication it was working. When it had finished I actually got a connection timed out page but once I reloaded I had just a handful of comments to moderate 🙂

Read More