Results 1 to 2 of 2

Thread: autorenaming files

  1. #1

    Thread Starter
    Addicted Member c@lle's Avatar
    Join Date
    Oct 1999
    Location
    Belgium
    Posts
    179

    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??

  2. #2
    Hyperactive Member vbud's Avatar
    Join Date
    Jan 2002
    Location
    Mru 20 17S, 57 33E Goal: Get out of the BOX Status: In The Shadows!!! Target Posts: 3,000,000,000
    Posts
    378
    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.
    >!v!<
    Free your mind, stop thinking
    http://inspirone.blogspot.com

    Please rate this post if it helped you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width