|
-
Mar 28th, 2002, 09:03 AM
#1
Thread Starter
Addicted Member
autorenaming files
hello,
i've used the example code of the 'copy file dialog box' for deleting files in a subdirectory.
see link http://www.vb-world.net/files/shfileop/
but now i want to copy files from one dir to another, but sometimes there are duplicate files. it seems to me that it is possible to 'autorename' this files?! is this true and if yes, how???
eg. source dir : file1, file2, file..., file20
dest dir : has eg file3, file7, file8
now i copy all the files from the source to the dest.
file1 ok
file2 ok
file3 duplicate so must become file4
file4 now duplicate! (just copied) so must become file5
file5 becomes file6
file6 becomes file9 (file7 and file8 where already there!)
file7 becomes file10
file8 becomes file11
...
how can i do this??
-
Mar 28th, 2002, 09:11 AM
#2
Hyperactive Member
Try using FileSystemObject. Before you copy any file to your destination directory, check for the existence of the file with FileSystemObject.FileExists which would return a flag. Then rename your files before moving them.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|