testare
Programmer
- Jan 21, 2005
- 127
Hi,
I would like to loop to a specific folder.
Then i would like to rename the files from .dat to .txt because then to find a specific text and if i find then move it.
i've started with this code but doesn't feel good.
I would like to use for each but i dont know how.
I would like to loop to a specific folder.
Then i would like to rename the files from .dat to .txt because then to find a specific text and if i find then move it.
i've started with this code but doesn't feel good.
Code:
Dim fso As FileSystemObject
Set fso = New FileSystemObject
sFolder = SourcePath & "C:\Temp\*.*"
sfile = Dir$(sFolder, vbNormal)
Do While sfile <> ""
Debug.Print sfile
fso.MoveFile "C:\Temp\" & sfile, "C:\"
sfile = Dir$
Loop