Forum Discussion
tristaanogre
14 years agoEsteemed Contributor
I'm using this simple code and it isn't renaming properly. It creates a new folder named SQLServer and pastes the "SQL Server" folder inside of it.
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?
Not long ago in this topic you showed me how to count itens inside of a file. It worked perfectly on the first 10 files. And then, with no reason, it just stop counting in a file, and, on the 12th file it counts correctly again. So, I separated the code from my sub and tested that file alone, and it counted normally.
It's getting really hard to track all these different questions in one thread. Could you repost this to a different thread, including the code causing your problem and, if possible, the file that you were trying to run through?