[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
  1. <# :
  2. cls&echo off&cd /d "%~dp0"&mode con lines=5000
  3. path %SYSTEMROOT%\System32\WindowsPowerShell\v1.0;%path%
  4. set "current=%cd%"
  5. powershell -NoProfile -ExecutionPolicy bypass "Get-Content -literal '%~f0'|Out-String|Invoke-Expression"
  6. pause
  7. exit
  8. #>
  9. $current=($env:current).trimend('\');
  10. $enc=New-Object System.Text.UTF8Encoding $False;
  11. $folders=@(dir -literal $current -recurse|?{$_ -is [System.IO.DirectoryInfo]});
  12. for($i=0;$i -lt $folders.length;$i++){
  13.     if($folders[$i].Name -eq 'juans'){
  14.         write-host $folders[$i].FullName -ForegroundColor yellow;
  15.         $arr=New-Object -TypeName System.Collections.ArrayList;
  16.         $files=@(dir -literal $folders[$i].FullName|?{('.xhtml' -eq $_.Extension) -and ($_ -is [System.IO.FileInfo])});
  17.         for($j=0;$j -lt $files.length;$j++){
  18.             write-host $files[$j].Name;
  19.             $text=[IO.File]::ReadAllText($files[$j].FullName, $enc);
  20.             $m=[regex]::matches($text, '<span class="text_2"><span class="corr">(.+?)</span>');
  21.             foreach($it in $m){
  22.                 [void]$arr.add($it.groups[1].value);
  23.             }
  24.         }
  25.         $newfile=$folders[$i].FullName+'\Cbeta.txt';
  26.         [IO.File]::WriteAllLines($newfile, $arr, $enc);
  27.     }
  28. }
复制代码
1

评分人数

提供bat代写,为你省时省力省事,支付宝扫码头像支付
微信: unique2random

TOP

返回列表