The example you show here is very alike the script i first posted here. But what it really does is not to extract the string '\desktop', but to remove the last 8 caracters from variable $x. This will not work if the length of the string to extract is unknown. But, then again, what help would it be to extract a pre defined string if it is unknown? im tired....

------------------
Magne