I have this code to return a directory listing in a folder

dir1=dir("c:\myfolder")
do until dir()=""
dir1=dir
loop

My problem is that I want to see the last file that would show up in the name column under details.

But if files names have spaces in them it does not like that

Anyone have any advice
thanks