Forum Discussion
joffre
14 years agoRegular Contributor
I'm sorry, I just did the exact same thing with no issue. What version of TestComplete are you using? What operating system version? Are you a local administrator for the machine being tested? Is there something else, some other process, using or populating that directory (such as another script that is writing files to that folder that may have that folder locked as in use)? There are all things that would cause a folder to not be able to be renamed. However, by itself, the code you posted successfully renamed a folder in Windows XP SP 3, TestComplete 8.5, and with the login as a local admin. Note, if the folder is in use or a file in the folder is in use, the Test Log will record this (see screenshot attached) but it won't log it as an error because a rename/move occurred. Could you double check your log files and see if you have any messages like this?
TestComplete version = 7.52.678.7
Operatin System version = Windows XP Professional SP3
I am local administrator.
The folder is new. I created it just to test the RenameFolder script.
My log stays blank.
Now, I've tried to rename a file with the following code and it worked perfectly.
Call aqFileSystem.RenameFile("C:\teste.txt","C:\teste2.txt")