本帖最后由 yhcfsr 于 2019-1-25 16:21 编辑
回复 2# xczxczxcz
WIN10- @echo off
- powershell -NoLogo -NoProfile -command "& {$files=ls *.txt -r;foreach($file in $files){$content=(type $file -ReadCount 0) -replace '我爱你',$file.BaseName;sc $($file.FullName+'.log') $content -encoding default}}"
- pause
复制代码 WIN7系统- @echo off
- powershell -NoLogo -NoProfile -command "& {$files=ls *.txt -r;foreach($file in $files){$content=(type $file -ReadCount 0) -replace '我爱你',$file.BaseName;sc $($file.FullName+'.log') $content -encoding String}}"
- pause
复制代码
|