Cannot be performed because dir is in use by another process

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
InfiniteLoop
Posts: 1
Joined: 24 Nov 2009 20:28
Location: Pittsburgh, PA

Cannot be performed because dir is in use by another process

#1 Post by InfiniteLoop » 25 Nov 2009 08:46

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

avery_larry
Expert
Posts: 391
Joined: 19 Mar 2009 08:47
Location: Iowa

#2 Post by avery_larry » 25 Nov 2009 11:20

not really. Do you know what the process is? Will it always be the same?

avery_larry
Expert
Posts: 391
Joined: 19 Mar 2009 08:47
Location: Iowa

#3 Post by avery_larry » 25 Nov 2009 11:22

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.

Post Reply