Hello,
Someone asked this question.
I need to copy a file C:\folder1\file1 to folder C:\folder2 but copy it with a timestamp added to the filename.
I currently have a schedule that copies the file to the folder but I need to retain other files already copied
and not overwrite them.
Following biterscript will do it.
# Start of script copyfile.txt
# Set source file to copy
var str source ; set $source = "C:\folder1\file1"
# Get the file name from the full path.
var str file ; stex "^\\^l[" $source > $file
# Set destination. It contains file name, an underscore, then timestamp.
var str dest ; set $dest = "C:\folder2"+"\\"+$file+"_"+gettime()
# Copy source to destination.
system copy ("\""+$source+"\"") ("\""+$dest+"\"")
# End of script copyfile.txt
You can schedule the script to run periodically. Save the above script in C:/Scripts/copyfile.txt. Schedule
the following command in task scheduler
C:\biterScripting\biterScripting.exe copyfile.txt
To download biterscripting , follow installation instructions at http://www.biterscripting.com/install.html . It's free.
Sen