Your question is a little too vague. I'm assuming that since you have to wait, the initial attempt to rename/delete has failed. Whether you will now wait or not will entirely depend upon the reason of failure. For example if the failure is permissions, this could be a long wait. If there is a lock on the file, you could wait the file to be unlocked. But again this could be a very long wait.
It's because UNICODE is enabled by default in VC2005, which was not the case with VC6.
it compiles correctly but at runtime its giving debug assertion failed error.
Well, you don't provide a lot of usefull information do you ? What is the exact problem ? Where does your code crashes ? Use your debugger to locate the problem more precisely and inspect the state of the different variables before the crash.