8 replies
by dklippert
Use the wildcard *
Edit your script change
MyFile.txt to
*.txt
by drhue
Poster rated this answer.
by drhue
I tried this however it caused a syntax error/ Here is the code I am using:
dim filesys
set filesys=CreateObject("Scripting.FileSystemObject")
filesys.MoveFile "c:\edi\snd\*.txt", "c:\snd\" & dave & "\"
by cptomlly
object.MoveFile ( source, destination ); (Where "object" is a FileSystemObject). The source argument can contain a wildcard in the last component so you could use "C:\data\txtfiles\*.txt"
You can find the complete reference for MoveFile method here: http://msdn.microsoft.com/library/en-us/script56/html/jsmthMoveFile.asp
If needed, here is reference to the FileSystemObject Object: http://msdn.microsoft.com/library/en-us/script56/html/jsobjFileSystem.asp
Hope this helps.
by cptomlly
I think you are getting syntax error because of the way you are declaring the destination. Try this:
dim filesys
dim destination as Str
set destination = "c:\snd\" & dave & "\"
set filesys=CreateObject("Scripting.FileSystemObject")
filesys.MoveFile "c:\edi\snd\*.txt", destination;
by cptomlly
by drhue
Thanks Fixed my problems.
by drhue
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending