Page 1 of 1

Cannot be performed because dir is in use by another process

Posted: 25 Nov 2009 08:46
by InfiniteLoop
In my batch file, I have the line

rmdir c:\backups /s /q

but when I run it, I get a message saying that it can't be performed because the directory is in use by another process. I'm not too sure why it's saying this, but is there a way to kill the other process in my batch file so that the command will always work?

Thanks

Posted: 25 Nov 2009 11:20
by avery_larry
not really. Do you know what the process is? Will it always be the same?

Posted: 25 Nov 2009 11:22
by avery_larry
Oh -- by the way -- make sure you're not trying to delete the folder if you're current working directory is inside it.

so make sure you're not at c:\backups trying to rm c:\backups. cd \ first.