Delete *xyz.jpg from entire drive

Does anyone know a way, preferably command line, to delete all files on a drive, including subdirectories, that fit the description *xyz.jpg?
Who is Participating?
John HurstConnect With a Mentor Business Consultant (Owner)Commented:
DEL *xyz.jpg /S should do it.

Open Command, and run DEL /? to see the options.

.... Thinkpads_User
Thomas GrassiConnect With a Mentor Systems AdministratorCommented:
I would also do this

del *xyz.jpg /s >c:\deleted.txt

this way you get a list of all the files you deleted
Pradeep DubeyConsultantCommented:
Yes, you can do that with the del command and use /s switch for the deletion from sub-directories. below is the list of switch you may need further:

/P            Prompts for confirmation before deleting each file.
/F            Force deleting of read-only files.
/S            Delete specified files from all subdirectories.
/Q            Quiet mode, do not ask if ok to delete on global wildcard
/A            Selects files to delete based on attributes
attributes    R  Read-only files            S  System files
John HurstBusiness Consultant (Owner)Commented:
@hrolsons - Thanks and I was happy to help.

.... Thinkpads_User
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.