Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Batch to list if some folder is missing two especific files  (Read 6720 times)

0 Members and 1 Guest are viewing this topic.

theruleof4

    Topic Starter


    Newbie

    • Experience: Familiar
    • OS: Unknown
    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!

    Hackoo



      Hopeful
    • Thanked: 42
    • Experience: Expert
    • OS: Windows 10
    Re: Batch to list if some folder is missing two especific files
    « Reply #1 on: June 08, 2020, 08:37:11 AM »
    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