I have this script that copies a file from one place to another. I use this to copy files over the network to my machine or to another place. I use this to automate coping many files like a batch file.
I need to time stamp the file name I'm copying to. So it needs to be done at the "fso.CreateTextFile" and at the f2.copy I think. I have no clue!
I need to time stamp the file name I'm copying to. So it needs to be done at the "fso.CreateTextFile" and at the f2.copy I think. I have no clue!
Code:
Dim fso, f1, f2
Set fso = CreateObject("Scripting.FileSystemObject")
Set f1 = fso.CreateTextFile("c:\temp\testtest{date}.txt")
f1.close
Set f2 = fso.getfile ("C:\SamsVBS\test.txt")
f2.copy ("c:\temp\testtest{date}.txt")