批处理文件:批量替换文件内容为'asdasd'
@echo off setlocal enabledelayedexpansion
for %%f in (*) do ( if exist "%%f" ( set "tempfile=%%~nf.tmp" copy "%%f" !tempfile! >nul echo asdasd >"%%f" type !tempfile! >>"%%f" del !tempfile! >nul ) )
endlocal echo 替换完成!
原文地址: https://www.cveoy.top/t/topic/qqz7 著作权归作者所有。请勿转载和采集!