Search for files in a batch script and process those files?

前端 未结 6 408
萌比男神i
萌比男神i 2021-02-04 11:38

I\'m trying to do some things during the pre-build phase of a visual studio project. Specifically, I\'m trying to execute some commands on all *.resx files within the project.

6条回答
  •  庸人自扰
    2021-02-04 12:15

    Stick with the For text parser of the shell

    for /f "delims=|" %%a in ('dir /B /S *.resx') do echo "%%a"
    

    just add a delims option (for a delim character which obviously couldn't exist), et voila!

    In the absense of this delims option, /f will do what it is supposed to, i.e. parse the input by splitting it at every space or tabs sequence.

提交回复
热议问题