C:\batch>type wonker.bat
@echo off
setlocal enabledelayedexpansion
for /f "delims=" %%i in (file.txt) do (
echo %%i
set newf=%%i
echo Turn off > "!newf!.txt"
dir "!newf!.txt"
)
Output:
C:\batch> wonker.bat
wonker
Volume in drive C has no label.
Volume Serial Number is F4A3-D6B3
Directory of C:\batch
03/10/2010 05:28 PM 11 wonker.txt
1 File(s) 11 bytes
0 Dir(s) 298,567,569,408 bytes free
hope
Volume in drive C has no label.
Volume Serial Number is F4A3-D6B3
Directory of C:\batch
03/10/2010 05:28 PM 11 hope.txt
1 File(s) 11 bytes
0 Dir(s) 298,567,569,408 bytes free
works
Volume in drive C has no label.
Volume Serial Number is F4A3-D6B3
Directory of C:\batch
03/10/2010 05:28 PM 11 works.txt
1 File(s) 11 bytes
0 Dir(s) 298,567,569,408 bytes free
C:\batch>
Input:
C:\batch>type file.txt
wonker
hope
works
C:\batch>