You might want to look at the PathSplit() UDF - latest version is in the UDF Library on my web site. It was written specifically to take a variable path and return an array of 4 elements - Server (if path begins with "\\", null otherwise), Share OR drive letter, Directory Path, and Filename. This lets you quickly manipulate any component and reassemble it. With the function, the complete path can be broken down by
 Code:
$aryFileParts = PathSplit('\\server\share\folder1\folder2\filename.ext')
which would return elements (1)=server, (2)=share, (3)=folder1\folder2, (4)=filename.ext.

Renaming a file extension is as simple as
 Code:
$Filename = Join(Split($Filename, '.txt'), '.doc)
, which changes the .TXT extension to .DOC in this example.

Unless I misunderstood, it seems like your question is more logic than GUI, no?

Glenn
_________________________
Actually I am a Rocket Scientist! \:D