Your problem is everytime the line do until dir()="" is executed you retrieve the next file. With the code you have you are retrieving every other file. Try using this code and see what you get.

dir1=dir("c:\myfolder")
do while dir1 <> ""
dir1=dir
loop