Use right() to check to see if the rightmost char of the directory path is a "\". If there is no backslash, then append one and then add + File on the end, and there you have it.