Ted you can also use something like this if you know how many folders to chop off the end. Gives you a bit more flexibility.
(defun _chop (string delimeter #2chop / n)
(setq n -1)
(while
(and (setq p (vl-string-position (ascii delimeter) string 0 t)) (< (setq n (1+ n)) #2chop))
(setq string (substr string 1 p))
)
string
)
;;Little test
(setq n 0)
(repeat 10 (alert (_chop (vl-filename-directory (findfile "acad.pgp")) "\\" (setq n (1+ n)))))