Sorry, I wasn't clear. I'm not trying to pull apart a file name into directories and basenames - just loop through a file, take each line with Win32 filenames and convert the long names into short names. The new line will be passed to another application that can't deal with spaces in names