-
Mar 31st, 2018, 05:47 PM
#1
Thread Starter
Frenzied Member
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 ??
-
Mar 31st, 2018, 06:02 PM
#2
Re: Can't rename file
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
-
Mar 31st, 2018, 06:17 PM
#3
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.
-
Mar 31st, 2018, 08:21 PM
#4
Thread Starter
Frenzied Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|