Windows bat: loop files in directories

后端 未结 2 853
北海茫月
北海茫月 2021-01-29 00:25

I\'m working on Windows. I have many jpg files in subdirectories of a directory. I don\'t know exactly the architecture of the directory, meaning that I don\'t know

相关标签:
2条回答
  • 2021-01-29 01:19
    If defined Files echo process.bat !files!
    

    should solve the problem - but whether process.bat will co-operate is yet to be determined. Would need you to list process.bat if required.

    0 讨论(0)
  • 2021-01-29 01:26
    @Echo off&SetLocal EnableExtensions EnableDelayedExpansion
    
    For /d %%A in (C:\dir\*) Do (
        Set "Files="
        For /F "delims=" %%B in ('dir /S /B "%%~fA\*.jpg"') Do Set Files=!Files! "%%~fB"
        If defined Files echo process.bat !Files!
    )
    
    pause
    
    0 讨论(0)
提交回复
热议问题