set DIR=UIDesigner-T5-C10
set path=E:\work_sefon\UIDesigner\
SET info=\scripts\app\business
set "DIR=%path%%DIR%%info%"
cd %DIR%
ECHO %DIR%
for /R %%s in (*.html) do (
ECHO %%s
)
pause
GOTO endbat遍历指定目录下的所有 html文件 ,但当在子文件夹下help中的文件我要做拷贝处理,其它文件夹下的文件我要做合并处理,请问下我在for循环下我要怎么去判断路径中是help路径下的html文件?
第1个回答 2017-04-25
1
2
3
4
5
@echo off
set /p folder=请输入文件夹关键字
for /f "delims=" %%a in ('dir /ad /b /s D:\Report') do (
echo %%a|find "%folder%" >nul &&(start "" "%%~a"&exit)
)
2
3
4
5
@echo off
set /p folder=请输入文件夹关键字
for /f "delims=" %%a in ('dir /ad /b /s D:\Report') do (
echo %%a|find "%folder%" >nul &&(start "" "%%~a"&exit)
)
第2个回答 2017-05-01
ECHO "%%~ps\"|findstr "\\help\\">nul &&(
echo %%s 文件在help路径下
)||(
echo %%s 文件不在help路径下
)本回答被提问者采纳
echo %%s 文件在help路径下
)||(
echo %%s 文件不在help路径下
)本回答被提问者采纳