Results 1 to 4 of 4

Thread: Can't rename file

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2010
    Posts
    1,462

    Can't rename file

    I'm trying to rename a file using the command

    Name oName as nName

    and getting error 58 "File already exists"

    This is sort of crazy as oName must exist to be renamed. (and nName does NOT exist).

    Any thoughts ??

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Can't rename file

    Any thoughts ??
    a virtualized folder, maybe you are trying to write to a protected folder and the vb file is attempting to write the the virtual folder, where the file may already exist, but you can not see it in explorer

    other than that not enough information
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3
    The Idiot
    Join Date
    Dec 2014
    Posts
    2,721

    Re: Can't rename file

    before you rename, do you check if file exists? even if you know for sure, its good to have before you rename.
    it is also important the path is correct. also, maybe you need the 8.3 shortpath as well, if you are dealing with long paths and/or with unicode characters.

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2010
    Posts
    1,462

    Re: Can't rename file

    Thanks for the replies. I really don't know what was wrong, but I made all the folders again and it's now ok.

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