ファイル名の配列があり、それぞれのファイル名を出力したい:
例: 配列に次のファイルが含まれている場合: C:\Windows\Directx.log 次に、Directx.log を出力します。
テキストファイルを反復処理すると、次のように実行できることがわかっています。
for %%F in ("C:\Documents and Settings\Usuario\Escritorio\hello\test.txt") do echo %%~nxF
繰り返しますが、これは配列であり、テキスト ファイルではありません。
これが私のコードです:
set filesCount=0
for /f "eol=: delims=" %%F in ('dir /b /s %SequencesDir%\*.%StandardExtension%') do (
set "filesArray!filesCount!=%%F"
set /a filesCount+=1
)
set /a secondCnt=0
:LoopArray
if not %secondCnt%==%filesCount% (
set CurrentFile=!filesArray%secondCnt%!
echo !CurrentFile!
for /f "delims=" %%A in ('echo(%CurrentFile:\=^&echo(%') do set ExactFile=%%~nxA
echo %ExactFile%
set /a secondCnt+=1
goto LoopArray
)
何か案は?