0

ola

I need to copy a file from one directory on my server to another. The thing is, if the file already exists in the destination folder, I need to copy it with a different name (i'd just like to add a 2 or something to the end of the fileName).

Is there any way to copy a file AND change the name?

2
Contributors
2
Replies
3
Views
11 Years
Discussion Span
Last Post by chmonalisa
0

Alright, I solved it. Turns out you can just put the name of the file right there in the copyFile line.
looks like this:

fs.CopyFile sourceFile, DestinationFolder & "\NEWFILENAME.txt", 1

Next time i'll look around a bit more before posting.
Rock on.

0

hey andrew,

Try this,


save the file name with a unique no.

and the unique no. is

day() & month() & year() & hour() & min() & second()

thanks,
Chaitanya.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.