Steve H
Steve H

Reputation: 493

Delete folder contents within a batch script, windows, without prompt

I am trying to write a batch script where I have to delete a folder's content, without deleting the folder itself. I tried using

del "." 

But it stops batch script at that point to ask me if I am sure about the deletion. I don't want any prompt. Is there an easier way to do this quietly?

Upvotes: 4

Views: 9768

Answers (1)

Kevin Richardson
Kevin Richardson

Reputation: 3622

del /q "."

/q: Quiet mode, do not ask if ok to delete on global wildcard

As with most commands, you can use del /? to see such options.

Upvotes: 4

Related Questions