vanna
vanna

Reputation: 1572

Delete pdf files in a folder using a batch file

I would like to run a batch (.bat containing DOS commands) that would clean my folder by deleting any pdf that is still there. How do you do that ?

Upvotes: 1

Views: 3979

Answers (3)

aglassman
aglassman

Reputation: 2653

http://ss64.com/nt/

Use /q and DEL commands.

Upvotes: 0

Robert Harvey
Robert Harvey

Reputation: 180878

del *.pdf /q

Explanation:

del   -- Dos command to delete files

*.pdf -- all files with the .PDF extension in the current directory

/q    -- Don't ask for confirmation.

Upvotes: 4

JMC
JMC

Reputation: 930

Assuming only one directory (no sub-directories): del *.pdf

Upvotes: 2

Related Questions