和批处理有关,for %%i in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%i:\ for /r %%i:\ %%i in (%filename%) do echo %%i>>results.txt ,为什么不行?
第1个回答 推荐于2017-09-19
必须开启变量延迟
@echo off
setlocal enabledelayedexpansion
for %%i in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
set dn=%%i
if exist !dn!:\ (for /r !dn!:\ %%h in (%filename%) do echo %%h>>results.txt)
)本回答被提问者采纳
@echo off
setlocal enabledelayedexpansion
for %%i in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
set dn=%%i
if exist !dn!:\ (for /r !dn!:\ %%h in (%filename%) do echo %%h>>results.txt)
)本回答被提问者采纳
第2个回答 2018-06-02
6225588585
第3个回答 2018-01-13
是字母