Directory of Y:\Bob\My Documents
14/01/2011 01:59 PM 10,411,520 MVI_1903_1.avi
1 File(s) 10,411,520 bytes
The file is named file1 but i need to rename it bob.txt
this seems simple and would make things a lot easier. thanks in advance

Moderator: DosItHelp
Code: Select all
for /f "tokens=2*" %%a in ('findstr /c:"Directory of " "file1.txt"') do (
for /f "tokens=2 delims=\" %%c in ("%%b") do echo %%c
)