If I understand you correctly you want to return the last directory name of the path. $path returns "c:\acf\swert\asd".
code:
Break ON
$Uprofile = "c:\acf\swert\asd\dir1"

$temp = $Uprofile
$x = instr($Uprofile, "\")
while ($x)
$path = $path + "\" + substr($temp,1,$x-1)
$temp = substr($temp,$x+1, len($temp))
$x = instr($temp, "\")
Loop
$path = Substr($path,2,len($path))
? $path
? "Account is " + Substr($Uprofile,len($path)+2,len($uprofile))



[ 14. November 2002, 21:38: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/