Answer the question
In order to leave comments, you need to log in
How to remove files containing a specific word in their name from a directory and subdirectories?
You need to make a bat-file, when launched, it will delete files from the folder in which it is located, and all subfolders.
wrote the following command: del /F /S /P D:\path\*слово*.*
(for a specific folder)
But, apparently, something is wrong.
Answer the question
In order to leave comments, you need to log in
You have already written everything, it remains only to save the command to the batch file and insert the parameter of the batch file in place of the word. Batch content:del /F /S /P "D:\path\*%~1*"
Since you specified the file name in the path directory alone, then for its subdirectories you must either specify this separately:
del /F /S /PD:\path\*\*word*.*
or (if the nesting is not known in advance) loop through recursively through subdirectories by doing
del /F /S /P *word*.*
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question