| @echo off | | set info=互助互利,支付宝扫码头像,感谢赞助 | | rem 有问题,可加QQ956535081及时沟通 | | title %info% | | cd /d "%~dp0" | | set 行数=3 | | set "result=.\结果" | | md "%result%" 2>nul | | powershell -NoProfile -ExecutionPolicy bypass ^ | | $files=@(dir -liter '%~dp0'^|?{('.txt' -eq $_.Extension) -and ($_ -is [System.IO.FileInfo])});^ | | for($i=0;$i -lt $files.length;$i++){^ | | write-host $files[$i].Name;^ | | $text=[IO.File]::ReadAllLines($files[$i].FullName,[Text.Encoding]::Default);^ | | if($text.length -ge %行数%){^ | | $text[%行数%-1]=$text[%行数%-1]+\"`r`n<h1>\"+$files[$i].BaseName+\"</h1>\";^ | | };^ | | [IO.File]::WriteAllLines('%result%\'+$files[$i].Name, $text, [Text.Encoding]::Default);^ | | }; | | echo;%info% | | pauseCOPY |
|