Rebuilding Vista’s Security Center cache

My notebook initially shipped with a load of crap like McAfee Internet Security (the trial of course), I had to uninstall all that stuff before it became usable. Now the problem is that obviously nobody at McAfee had the idea that some people would actually uninstall the software.

I did, though, and was left with some undeleted entries in the Security Center, q.e.d., which proves to be a royal p.i.t.a. if you get this analogy. So, to remove these buggers I did…

  1. Stop the Windows Management Interface service
  2. Delete C:\Windows\System32\Wbem\Recovery
  3. Start the service again
  4. Reboot

Now Windows only shows the software that is actually installed instead of bazillions of dead, non-existent ghosts. The Windows Management Interface service keeps a cache that gets rebuilt on every reboot (or so the wise interweb says).

Problem solved, Tsukasa happy.

Installing services from PowerShell (the elaborate way)

Since we’ve got access to all classes and namespaces in the .net Framework in PowerShell, let’s have some fun.

Normally you install Windows services through the sc command or the installutil tool from Microsoft. But what does the installutil, exactly?

Basically it parses the incoming input and — if not specified otherwise — passes it through into a function called InstallHelper() in the System.Configuration.Install namespace. We can do the same with PowerShell, leaving out all the pesky problems of finding a suitable instance of installutil:

[System.Configuration.Install.ManagedInstallerClass]::InstallHelper("MyService.exe")

If run with elevated rights you should see that the transaction is successful and your service should show up in Computer Management.

Scripting “sudo” with PowerShell

Now that I finally have some time on my hands to get a little into Microsoft PowerShell again I decided to work on small things to remember what I learned once (aeons ago 😉 ).

And guess what, there was a practical command I always lack on Windows, it’s the great sudo command from the Unix/Linux world. It basically starts a program with elevated rights (just the rough idea).

Because doing it yourself is fine but looking how other people do it is just as nice I decided to consult Google and found Peter Provost’s great post for a PowerShell script that does exactly what I wanted.

The script launches a new process with elevated rights, only one thing was bugging me a little (yeah, I’m nitpicking now!): I had to provide the full path to the executable. Gee-wiz, how dare you!

Easy to fix with the addition of a few lines of code:

if([System.IO.File]::Exists("$(get-location)\$file"))
{
$file = "$(Get-Location)\$file";
}

Now I can just type i.e. “sudo MyApp.exe” or “sudo MyDir\MyApp.exe” when the application is in that very directory and it launches.

I really enjoy myself working with PowerShell again. Personally I think it’s a shame this great piece of software isn’t a default part of Windows Server 2008 just because it’s .net based (yes, that’s the reason, you can’t install .net on Server Core setups without kinks)…

Sandboxie

Products that "bottle" applications inside the operating system are more popular than ever. Let it start with products like HDGuard or Dr. Kaiser DRIVE and let it end with something along the lines of Citrix.

For practical use these solutions are a little impractical though; I often need on-the-fly sandboxing for applications. That's where Sandboxie comes in pretty handy: The program is a simple to use but powerful Windows application that enables the user to bottle applications inside a sandbox, monitor the changes and delete these changes afterwards (or import them into the real filesystem, whatever you like best 🙂 ).

It really works great and adds a lot of practical use cases for testing or monitoring. The tool is shareware, most of the features work in the unregistered version.

If anyone has a similar free tool (open-source would be perfect, I'd like to peek into the code 🙂 ) feel free to comment (oh please do!).

Just a few lines on GTK

GTK deprecates things faster than building on-par alternatives. Got messaged a few days ago, it seems eggtray is really about to meet it’s (undeserved) end in favor for it’s bastard infant overlord GtkTrayIcon. Needless to say that GtkTrayIcon is not feature equivalent with it’s precessor (which is a shame).

GTK also has the habit of using ridiculously long names for it’s function names. I’m not writing a fscking novel here, but program code. Yeah right, don’t give me that look, I’m writing program code for it to work, not to win the Pulizer price.

void gtk_will_win_me_the_pulizer_price_oneday(GtkStupidObject *bullshit) or what?

Please organize your project a little more and stop punching useless, not-quite-so-ready controls down people’s throat GTK!

Script: Autosorting start menu entries in Windows XP

One of the most annoying things in Windows is that start menu entries don’t get sorted alphabetically by default. I mean, sure… there is a practical reason for this and I won’t deny that reordering the items can be useful at times.

For my primary usage though — it is not. So I spent some time into a simple script, made of two units: a batch file that acts as the "caller" and a VBscript that’ll do some nitty gritty plumbing (actually not too much, though 😉 ).

It is based on the works featured in Script Guy, so without further ado:

startmenuautosort.vbs

On Error Resume Next

Const HKEY_CURRENT_USER = &H80000001

strComputer = "."
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Start Menu2"

Set objRegistry = GetObject("winmgmts:\\" & _
strComputer & "\root\default:StdRegProv")

DeleteSubkeys HKEY_CURRENT_USER, strKeypath
objRegistry.CreateKey HKEY_CURRENT_USER, strKeyPath
MsgBox "Done!"

Sub DeleteSubkeys(HKEY_CURRENT_USER, strKeyPath)
objRegistry.EnumKey HKEY_CURRENT_USER, strKeyPath, arrSubkeys

If IsArray(arrSubkeys) Then
For Each strSubkey In arrSubkeys
DeleteSubkeys HKEY_CURRENT_USER, strKeyPath & "\" & strSubkey
Next
End If

objRegistry.DeleteKey HKEY_CURRENT_USER, strKeyPath
End Sub

DoMenuAutoSort.bat (or whatever you like to call it):

@echo off
set PATH=%PATH%;%CD%\$sys

wscript //B startmenuautosort.vbs
subinacl /subkeyreg "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Start Menu2" /deny=Jeder=F > nul

exit 0

Please note for this script to work you’ll need the Subinacl utility from Microsoft, placed into a subfolder below the script called $sys. Don’t worry, even though the utility comes as an .MSI installer you can simply copy it from your Program Files and place it in the $sys subdirectory and it’ll work on other systems.

Basically this whole thing deletes all entries under Start Menu 2 in the registry and denies any privilegue to the key. Please also note that in the German version of Windows XP the world group is called Jeder, so change it according to your needs.

*buntu debutes

I'm pretty sure BeOS fans remember the name Bernd Korz. He's the head behind now defunct Zeta (a BeOS distribution without proper license). After having shutdown Zeta development due to shady and improper licensing (was there some kind of agreement at all?) it became quite silent around Korz.

He's back now, though. And he brings along a grotesque named Zebuntu, a Linux distro that apparently features BlueEyedOS in it's foundations; enabling it to run BeOS apps with very little work.

Now, just let me ask the silent reader: Why?

If I'd really want to do something like this I could just install the necessary tools for it. There is absolutely no need for another dedicated distro with this as it's focus.

But then again: It's free software and nobody forces me to use it, so… who cares.

Someone who will care is Mr. Cash Mark Shuttleworth who'll probably not be happy that someone is riding on his *buntu distro naming scheme again. But then again, I care about Mr. Shuttleworth about as much as he cares about me… so… 

One good thing about Vista…

There is one really good thing about Windows Vista: It poses the perfect excuse to deny installing 10-year old 16bit applications.

Frankly, I'm shocked about the high percentage of legacy applications still in use. About every week we're having trouble with these old programs at work, breaking down under all the permissions and group policies.

People should get one thing straight: Just because an application works on a old 90MHz machine doesn't mean it works on a dualcore 2GHz beast. And time probably didn't stop, there should be a sufficient replacement for a 10-years old application.

ProcMon is quite a useful tool for people plagued with these junk pieces. The compatibility mode also proves itself to be useful at times. But come on, why bother?

Either you don't upgrade your old systems and just keep the applications running on Windows 98 or you say bye-bye to the machine, the OS and the application and move on. Everything else is just blasphemy. 

TrueCrypt 5

A new version of TrueCrypt, the open source on-the-fly disk encryption software, has been released. This update bumps the version number up to 5.

Among a Linux GUI and several other nice things a real biggy is a new feature that allows to encrypt complete Windows installations. You don’t have to reinstall Windows, the software will encrypt files on-the-fly while you’re working.

Unnecessary to say but encrypted file-systems do not deliver the same performance as unencrypted ones.

First impressions: Creative EP630 earphones

Ever since my iPod earphones died on me (must’ve been sometime in 2007) I was in search of decent earphones. Ordering another pair of shitty Apple run-of-the-mill earphones was out of question, the sound was just terrible and the hardware is/was inexcusable high priced.

On a whim I ordered Creative’s EP630 earphones. Earphones may be a little misleading here, for they’re actually in-ear phones.

One has to be sceptic: Is it really healthy and safe to use some oropax-like phones? I don’t think it is.

The vital point is the sound though. Can this pair of small speakers really deliver good sound? Actually, yes.

The sound is reasonably good, in-ear phones block out noises from the environment pretty well so they’re perfect for my use in trains and whatnot. A crucial point for the quality of sound is the position of the speakers. If placed wrong the sound is just shallow and bad. On the other hand, when placed correctly the speakers deliver a good performance. I can’t really comment on specifics here.

The EP360 definetively do not rival my real studio phones. In fact they’re worlds apart but with about 20€ the price for the EP360 is quite okay.

A word about Qumana

A while ago I was pondering about blogging clients (again?!). I vowed to intensively test Qumana and report back (or at least I intended to 😉 ).

Now, I’ve been testing Qumana for a while now. In fact, all posts ever since have been published with Qumana. Sounds like a good idea to give my final verdict (until I test programs again, that is).

Qumana is awesome.

I don’t call everything I come across awesome, but this software is very nice. Let me illustrate it for you:
Time paradox!

Yeah, scaling in this software is a little bit bah, but hey… it’s free and it actually is able to upload images (QED 🙂 ) . The interface is pretty slick and clean, just like BlogJet (which I adore as well). Most points in the interface are pretty much self-explanatory.

But not everything is sunshine and kittens: Although the software is written in Java it doesn’t work on Linux thanks to the dependencies on some DLLs. The big fugly main toolbar can’t be hidden or at least reduced in size, I can’t hide the Insert Ad button (which I frankly neither want nor need, but hey — that’s what keeps the software free I guess).

Apart from that: Try it yourself. Personally I think for zero bucks this is a great piece of software.

Mehr lecker Links

Ich will nochmal darauf hinweisen: Auch wenn ich nichts poste, ich surfe und bookmarke fleißig 🙂 .

Meine del.icio.us Bookmarks füllen sich ständig weiter mit interessanten und kuriosen Links zu den Themen Software, Betriebssysteme, Do-it-yourself Hardware, .net und Linux/Solaris/Unix. Und manchmal kommt sogar ein Link zu irgendwelchen — meißt nicht jugendfreien — Picturepages japanischer Zeichner dazu.