Search XML files in directory for specific string then do copy action using bat script
问题 I'm new to batch scripts so I would appreciate commented solution if possible. I'm looking for a bat script that would search set directory c:\in containing XML files for files that contain "xyz" string (in them, not in their filename). Once the file with "xyz" is found it should be copied to another location c:\out . For illustration purposes all of XML files have the same structure and the string (that files should be search for) is within the tag . 回答1: @ECHO OFF SETLOCAL SET "sourcedir=U: