How do I change a file name with es.exe?
How do I change a file name with es.exe?
I want to find foo.txt and rename it to bar.txt. How do I do that with es.exe?
Re: How do I change a file name with es.exe?
Code: Select all
for /f %A in ('es -n 1 foo.txt') do set esfile=%A
rename %esfile% bar.txt
If you would like to do this from a BAT file, use:
esrn.bat
Code: Select all
for /f %%A in ('es -n 1 %1') do set esfile=%%A
rename %esfile% %2
esrn foo.txt bar.txt
I recommend searching for foo.txt with:
es foo.txt
and manually renaming the desired result with:
rename <old-filename> <new-filename>