Björn:

Why are you using the ExpandEnvironmentVars() function? That's extra overhead in this situation, as environment vars are expanded automatically in normal strings.

When you really need to use it is when you are reading Registry or INI strings that might have embedded environment vars.

Just a minor ripe nit to pick. ;\)

Glenn
_________________________
Actually I am a Rocket Scientist! \:D