以下批处理文件为什么在win10上能够运行,在win7上不能运行,求大神帮忙解 10
代码如下:2种方式1.1.@echooffecho正在修改文件,请稍后.....for%%ain(*.txt)do(ifexist$del/q$for/f"delims=...
代码如下:2种方式
1.
1.
@echo off
echo 正在修改文件,请稍后.....
for %%a in (*.txt) do (
if exist $ del /q $
for /f "delims=" %%b in ('findstr "G00" "%%a"' ) do echo %%b>>$
for /f "delims=" %%b in ('findstr "MOM" "%%a"' ) do echo %%b>>$
if exist $ (
move $ "%%a"
) else (
del /q "%%a"
)
)
echo 文件修改已完成!
pause
2.
@echo off
set tmpfile=tmp%random%.txt
for /r %%a in (*.txt) do (
( for /f "usebackq delims=" %%b in ("%%a") do ( echo %%b | find /i "G00"||echo %%b |find /i "MOM"))>%tmpfile%
move /y "%tmpfile%" "%%a"
)
PAUSE 展开
1.
1.
@echo off
echo 正在修改文件,请稍后.....
for %%a in (*.txt) do (
if exist $ del /q $
for /f "delims=" %%b in ('findstr "G00" "%%a"' ) do echo %%b>>$
for /f "delims=" %%b in ('findstr "MOM" "%%a"' ) do echo %%b>>$
if exist $ (
move $ "%%a"
) else (
del /q "%%a"
)
)
echo 文件修改已完成!
pause
2.
@echo off
set tmpfile=tmp%random%.txt
for /r %%a in (*.txt) do (
( for /f "usebackq delims=" %%b in ("%%a") do ( echo %%b | find /i "G00"||echo %%b |find /i "MOM"))>%tmpfile%
move /y "%tmpfile%" "%%a"
)
PAUSE 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询