- @echo off
- set info=互助互利,支付宝扫码头像,感谢赞助
- rem 有问题,可加QQ956535081及时沟通
- title %info%
- cd /d "%~dp0"
- set "新文件夹=D:\new"
- md "%新文件夹%" 2>nul
- powershell -NoProfile -ExecutionPolicy bypass ^
- $searchstr='搜索的指定内容';^
- dir -r^|?{($_ -is [System.IO.FileInfo]) -and ($_.Extension -eq '.xml')}^|%%{^
- $f=$false;^
- $text1=[IO.File]::ReadAllText($_.FullName, [Text.Encoding]::Default);^
- $text2=[IO.File]::ReadAllText($_.FullName, [Text.Encoding]::UTF8);^
- if($text1.Contains($searchstr)){$f=$true;};^
- if($text2.Contains($searchstr)){$f=$true;};^
- if($f){^
- write-host $_.FullName;^
- cp -liter $_.FullName '%新文件夹%' -force;^
- };^
- };^
- write-host '%info%' -ForegroundColor green;
- pause
复制代码
|