WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Error Codes

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

FileRename 1025 Error


Question:

I am trying to rename a directory and get a "1025 File Rename: Rename failed"

(Actually I am really trying to move C:\testc\*.* to D:\Testb\*.*) But the rename failed on that so I tried a simple test case, which also failed:

fd = "C:\testc"
td = "D:\testd"
a = DirExist(fd)
b = DirExist(td)
If a && !b then
dirrename(fd, td)
endif

Answer:

You cannot FileRename a file from one volume to another. It will not "rename" from C to D.

However you can FileMove the file. (and FileMove is smart. It it is going to the same volume..it does a FileRename instead. Otherwise it has to copy the file and the delete the original.

Also you should be aware that you cannot rename the current working directory. You must first change to a different directory on that drive before the rename operation will succeed.


Article ID:   W16440
File Created: 2005:02:18:12:20:36
Last Updated: 2005:02:18:12:20:36