Re: BATCH rename files using a criterion txt file?
Posted: 06 Apr 2012 12:44
Well... I've been playing around with your scripts:
And kinda figured out what it means in BATCH:
It does the same job.
Two things:
not necessary?
Not for the user's input? But waits for input redirected from the file log.log?
Code: Select all
@echo off
setlocal enabledelayedexpansion
< "log.log" (for /f "delims=" %%a in ('dir *.txt /b /o:n') do (
set var=
set /p "var="
if defined var ren "%%a" "!var!%%~xa"
)
)
pause
And kinda figured out what it means in BATCH:
Code: Select all
@echo off
setlocal enabledelayedexpansion
(for /f "delims=" %%a in ('dir *.txt /b /o:n') do (
set /p "var="
if defined var ren "%%a" "!var!%%~xa"
)
) < "log.log"
pause
It does the same job.
Two things:
Code: Select all
SET var=
not necessary?
Code: Select all
SET /P "var="
Not for the user's input? But waits for input redirected from the file log.log?