0
正在對內部變量的文件名和目錄進行評估。如何批量存儲文件的名稱作爲變量而不進行評估?batch:在for循環中評估變量的文件名
EG:我的路徑是:
"C:\Rare\Names in a File\%CD%\"
batchfile.bat
file.txt
我要運行這個目錄裏面的腳本:
REM #####BATCHFILE.BAT#######
pushd "%dp0"
for %%A in ("C:\Test") do set EXEPATH=%%~A
for %%A in ("Test.exe") do set EXECUTABLE=%%~A
for %%A in ("%CD%") do set DIRNAME=%%~A
for %%A in ('dir /b /a-d "*.txt"') do (
SET FILENAME=%%~A
CALL :PROCEDURE
)
exit /b
:PROCEDURE
start /w "" "%EXEPATH%\%EXECUTABLE%" "%DIRNAME%\%FILENAME%"