Tuesday, December 30, 2008

Vista SP1 - useless files remover

If you have Windows Vista (XP users - give it up, its really old, its time to move on) and you've instaled SP1, you may well have a huge pile of completely useless files hanging about on your C: drive. They are pre-SP1 files that would only be used if you deinstalled SP1, and I've yet to see any real reason to do this, SP1 seems to be generally a very good thing.

You already have a tool to do this - it will free up some space, anything from nothing (if you installed Vista with SP1 included) to over 1gb, but will mean SP1 disappears from Add/Remove Programs.

To run this, go to a command prompt (right click and Run As Administrator if using UAC) and enter the command:

c:\windows\system32\vsp1cln.exe

It'll ask you if you're sure and then churn away for up to about 3 minutes and suddenly you'll have loads of space. Nice.

Thanks to TechRepublic for the tip: http://www.builderau.com.au/video/soa/Remove-Windows-Vista-SP1-installation-files/0,2000064338,22461499p,00.htm

Monday, December 15, 2008

The Mystery of the Missing System DSNs

Have you ever created ODBC System DSNs to see them instantly vanish before your very eyes? This is a spodadic problem on Windows 2003 and XP at least. This is not the biggest problem in the world - the global recession and the wars in the Middle East are at least as bad, but its bothered me for a while. The ODBC DSNs are there in the registry and even work if called directly but will not be listed. This was only a problem for me recently when I had an app which relied on listing them so I had to actually find a solution.

In case anyone else has this, look at this registry key:
HKLM\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources

There should be a (Default) REG_SZ with a blank value. This is wrong - it should say "Value Not Set". Delete that one value and it will reproduce itself instantly, then reopen ODBC Data Sources and it suddenly notices it has DSNs!

Good old registry, never fails.

Thursday, December 11, 2008

Using Event Viewer to trigger actions

For a while I have been using Vista and Server 2008's lovely Event Viewer as a stick to beat Windows XP/2003 obsessives who refuse to move on. Its great! You right click on an event in Event Viewer and click "Attach Task To This Event" and just fill in the blanks. Its one of those features that is so obvious - getting a machine to automatically do something if that happens again, like email me or fix what just blew up - that you can't believe its never been there before.

This is a dangerous route down which to go of course. Previously we've installed a system then kept a careful long term eye on events to make sure it was all fine tuned and set up right. Now we can just bolt together something half workable and put in loads of custom tasks in event viewer to deal with the constant crashes! But we won't of course. We're professionals.

Anyway, getting to the point, it appears Windows 2003 had this feature all along. and for all I know, so did previous OS's. Its not as nifty, granted, but the command line tool EventTriggers will do basically the same thing, which makes me annoyed what I never found this before, since i I can think of loads of times it would have been really useful. Now we're finally moving away from Server 2008 I finally work out how to use it!

More info at: http://www.computerperformance.co.uk/Logon/VBScript/eventtriggers.htm