1.

Solve : Batch to list if some folder is missing two especific files?

Answer»

Hi guys, I would like help to CREATE a batch script.

Here's my problem, I have a folder with many subfolders, and some of them need to have a certain image file:  "Cover.jpg", some of them have, but others are missing ... and there are hundreds of FOLDERS to check ... I managed to find this bat:

Code: [SELECT]echo off
for /d /r %%f in (*) do (
if not exist %%f\Cover.jpg (
echo %%f >>W:\HD\Cover_Missing.txt
)
)
The problem is that it returned many results, like parent folder.. then I wanted to improve it by placing the condition that in addition to having the file "Cover.jpg" having the file * .mp3 or * .m4a.. so the RETURN would be less to analyze ....

Could someone help me by doing ... I know very LITTLE about programming

Thank you!You can try with the command Where /?
Example :
Code: [Select]echo off
Set Source=%~dp0
Set Pattern=Cover.jpg *.mp3 *.m4a
Where /R %Source% %Pattern% /F
pause



Discussion

No Comment Found