发布网友 发布时间:2022-04-24 05:02
共3个回答
热心网友 时间:2023-08-16 15:30
@Echo Off
SetLocal EnableDelayedExpansion
Set /P File=请拖入需要处理的文件:
Set /P Str=请输入需要替换的字符串:
Set /P Replace=请输入替换后的字符串:
Set File=%File:"=%
For /F "Usebackq Delims=" %%i In ("%File%") Do (
Set "Line=%%i"
Echo !Line:%Str%=%Replace%! >>New.txt
)
以上为代码,请保存为.bat文件后双击执行
热心网友 时间:2023-08-16 15:30
XCOPY X1:\XXX1 X2:\XXX2说明: X1是指源文件夹所在的盘符如C、D XXX1是指你要复制的源文件夹 X2是指复制所到的目标盘符如E、F XXX2是指复制所到的目标文件夹举例: XCOPY C:\FILM D:\WU\PCV\2015 XCOPY D:\244\AK D:\FIL06\XW\7P
热心网友 时间:2023-08-16 15:31
@echo off
SETLOCAL EnableDelayedExpansion
cd %cd%
rem all xml file of current dir
for /R %%s in (*.xml) do (
echo %%s
rem 'exp/pano_editor' is old string,'%HTMLPATH%' is a new string
powershell -Command "(gc %%s) -replace 'exp/pano_editor', '%%HTMLPATH%%' | Out-File %%s"
)
@echo finished!
SETLOCAL DISABLEDELAYEDEXPANSION