rem setlocal enabledelayedexpansion echo off if exist todel.txt del todel.txt pause for /f "delims=" %%i in (tmp1.txt) do ( echo %%i for /f "delims=" %%j in ('dir /A-D /B "%%i"') do ( echo %%i%%jtodel.txt ) ) notepad todel.txt pause
1.批处理调用VBS,并获取VBS的返回值 批处理 yztest.cmd: @echo off ::take care of below command, never use it in this command, for this will disable char !. ::setlocal enabledelayedexpansion for /f "delims=" %%a in ('cscript. //nologo yztest.vbs "hello"') do ( set strFromVBS=%%a ) VBS ...