I am using Kix 3.60. I'm sure this is already provided in a mroe recent version, but can't take the time right now to upgrade and risk having to debug anything that may result from the change. So, being fully aware that I am doing this the hard way, here is what I am trying to do... I need to identify the path that the user profiles are kept in, regardless of NT or 2K operating system. Here is what I tried:

do
$temp = instr ($UProfile,"\")
if $temp > 0
$position = $temp
endif
until $temp = 0
$ProfilesPath = substr($UProfile,1,$position)
"Profiles path = " $profilesPath
sleep 10

It went into an endless look though, as you might imagine. My goal was to find the last \ and then pull the part of the string that preceeds it. BTW, my $UProfile is the path to the profile directory of the current user...
c:\winnt\profiles\username or
c:\documents and settings\username
I thought about just searching the $UProfile value for the username, but there are often times where the path is part of the username ending in ~1, so this wouldn't work.
Anyway, I guess what I am after is a way to look for the \ character repeatedly until it isn't found again. Any suggestions?