All posts by cyleft

i am like the deep blue ocean

Windows XP Disk Cleanup Takes A Long Time To Start

Microsoft Windows XP comes with a utility called Disk Cleanup. You can find it by going to:

Start Menu -> All Programs -> Accessories -> System Tools -> Disk Cleanup


If Disk Cleanup is taking an annoyingly long time to start up because it is ‘scanning for old files to compress’, you can force it to stop this scan. All you need to do is modify the registry. Using regedit.exe or similar tool, browse to this key:



Find the ‘Compress old files‘ registry key and rename it. Save and close.

You can find Microsofts knowledge base article on this here:

Current password is not correct

What The Error Message Said..

When starting windows you get this message at the login prompt:

“When trying to update a password, this return status indicates that the value provided as the current password is not correct.”

Why Did This Happen?

Most likely, I was trying to recover the password.


Replace the SECURITY/SAM file that lives in C:\WINDOWS\system32\config


To do this you need to access C drive in your computer without running Windows that is installed on that C drive. You can start the computer using a boot disk such as BartPE (see Google for detailed instructions). You can also move the disk to another computer and make the changes on that computer (see Google for detailed instructions).

Where do I get the SECURITY and SAM files?

If you are pretty stuck, try getting these from a fresh install of the OS you are working on (most likely this was Windows XP). Otherwise you should have a backup of these files since you were smart and backed them up before you messed about with them.

Using mplayer/mencoder to convert to an MPEG

MEncoder is a useful media encoder that comes with MPlayer The Movie Player

To use, you’ll need to download and install MPLAYER as well as the extra plugins. You may also need Real Player, Quicktime, Windows Media Player installed (or an alternative.)

OK I’m always having to lookup the mencoder flags for encoding video files, so heres a useful example:

c:\mplayer\>mencoder.exe input.file -of mpeg -ovc lavc -oac lavc 
                  -lavcopts vcodec=mpeg2video:acodec:mp2 -o output.file

of = Output File ovc = Output Video Codec

The rest of the options can be looked up.

Cannot delete AVI/MPEG Video Files

This problem occurs when windows is trying to show you a preview picture of your video, whilst you are trying to delete the file. So then you get a message telling you the file is still in use and the delete operation fails. Solution? Stop windows from showing you thumbnail images of your videos.

Start -> Run -> regedit
Edit -> Find

In the search box type this:


Tick the box titled ‘Keys’ and untick the others. It should find the key for ‘AVI Properties handler.’ Right click the key from the left window pane (with the folder tree view) and click export. Choose a file name to export the key to, and click OK. Now you can delete the key you just exported. If anything goes wrong, you can double click the .reg file you just created to restore the key.

You can also delete the following keys:

Video Media Properties Handler

Video thumbnail extractor

Working with Microsoft SQL Server MDF LDF Files

This article is about .MDF and .LDF files. These files are created by Microsoft SQL Server, and if you have some of these, and you want to view their contents read on.

The files I had originated from a Microsoft SQL Desktop Edition 2000 (MSDE) server. I’m assuming these instructions will work for other versions as well.

Download MSDE2000

You can download the 42MB MSDE 2000 Release A file from here:

Install MSDE2000

If you run the file you saved it will ask you to choose a folder to extract the setup files to. Please select a folder, or just click next. The files will unpack.

Open a command prompt from Start ->All Programs -> Accessories -> Command Prompt

It will show you something like this:

Microsoft Windows XP [Version 5.1]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\username>

Type the following in and press enter:

C:\Documents and Settings\username> cd C:\the\folder\you\extracted\your\files\to\goes\here
C:\the\folder\i\extracted\my\files\to> setup.exe SAPWD=YOUR_PASSWORD_GOES_HERE
This is the type of window that should show next
This is the type of window that should show next

Setup will commence, and you should have your server installed.

Graphical Administration Tool

I tried this, but couldn’t get it to work. I wasn’t using IIS.

Command Line Administration using OSQL

OK back to basics. osql.exe is in this folder:

%ProgramFiles%\Microsoft SQL Server\80\Tools\Binn\

By default this is:

C:\Program Files\Microsoft SQL Server\80\Tools\Binn\

Open a command prompt and cd into that directory:

C:\...\80\Tools\Binn\>osql /?
usage: osql         [-U login id]       [-P password]

Read the stuff that it prints out here.

The -E’ switch means trusted connection, so we’ll use that to login

C:\...\80\Tools\Binn\>osql -E

1> sp_help
1> go

A whole load of text will fly by. This is the output of the sp_help command. Type ‘go’ and hit return to execute the commands you have typed in at the prompt.

Attaching the MDF/LDF Files:

To view your MDF/LDF files  you need to attach the database files to the server. The commands are as follows:

1>   @filename1 = N'C:\YOUR_FILE.mdf',
1>   @filename2 = N'C:\YOUR_FILE.ldf'

To view info on the databases currently attached, you can use these commands:

1>select * from sysdatabases

You can now use SQL statements as follows:

1>select * from YOUR_TABLE_NAME

If you want to output the result of your SQL query in a file use:

C:\...\Binn>osql /E /d YOUR_DB_NAME /Q "select * from YOUR_TABLE_NAME" -o outputfile.txt

If you want to authenticate using a host/username/password to login:

C:\...\Binn>osql /U sa /P YOUR_PASSWORD /d YOUR_DB_NAME /S /Q "select * from YOUR_TABLE" -o outputfile.txt

Some more useful commands:

1>sp_helpdb mydb

1>EXEC sp_grantlogin ‘Test’
1>EXEC sp_grantdbaccess ‘Test’, ‘database_name’
1>EXEC sp_addlogin ‘test’,’hello’
1>EXEC sp_password ‘OLDPASS’, ‘NEWPASS’,’Test’


Microsoft .NET Framework 3.0 SP1 error 2711

Whilst installing .NET framework 3.0 Service Pack 1, I accidentally pulled the power cord on the laptop. When I started up again, it kept giving me the 2711 error message.

Cleaning the temporary file folders didn’t solve this. The answer was stowed away on a forum found via google:

  • Go into Start Menu -> Control Panel -> Add/Remove programs
  • Find the  ‘.NET framework 3.0’ entry and click the ‘change‘ button
  • The setup will run, you should select the repair option.
  • Once that completes, you can rerun the SP1 setup and it should work fine.

Zombie laptop

Lesson of the day: Some laptops don’t spin up CPU fans or switch on the screen when powering up

So I had a laptop which stopped working. None of the lights came on except for the charger light when the battery & charger were connected. The power button didn’t do anything.

I assumed it wasn’t working because the CPU fan wasn’t spinning up after pressing the power button (like a desktop computer would.) I tried opening up the laptop, removing and connecting everything up outside of the case, which then got it working. The CPU fan doesn’t spin up at boot time, so it’s pretty hard to troubleshoot the issue.

Basic Checks

Something you can try first is to find the documentation for your laptop/notebook. Try to find the service manual as well.

Check your battery. Get hold of a multimeter and check out the voltages and currents coming out of the battery terminals. You may find the expected voltages/currents in the service manual. This way, you can tell if the battery is working or not. If your battery is working, it should allow you to start the laptop, even if the charger is having problems.

Check your charger. Check if the fuse has blown on the charger’s plug. Check for lights on your power adapter (charger). The charger is often the culprit.

Sometimes your charger is fine, but the charger connector on the laptop is messed up. In this case, you’ll have to wiggle the wire around, and hold it until the charging light shows. Make sure the battery is plugged in when you do this, otherwise the charging light wont show at all. Sometimes, a bit of pressure upwards/downwards or sideways does the trick and gets your charging light showing again.

If you are sure your battery isn’t dead, your battery holds charge, and/or your charger is working, then you can try the power button. Try holding it down for a couple of seconds, and wait around 10 seconds to see if it’s having any effect.

If your power button isn’t helping, you can try re-seating the RAM memory module. You should check your manual for how to do this.

If re-seating RAM doesn’t help, try removing and reinserting the hard disk drive.

You may have a problem with the graphics card/display. Some machines overheat after long periods and this messes up some of the parts and connections which get hot, like the graphics chip.


Your laptop isn’t worth spending a lot of money on to have it repaired? Take it apart and have a closer look. You’ll need a working battery and/or a power adapter, and a service manual to do this. Keep a log of the order in which you take out screws, and keep each group of screws separate. For example, I’d write,

Step 1: remove 3 screws securing keyboard to top of case, and then place them together

This way it makes it a lot easier to put it back together, you just follow the steps backwards. Don’t lose/mix up the screws, you won’t remember which ones go where.