Function to retrieve the highest version in a folder