Re: The killer space!
- From: Tom Lavedas <tglbatch@xxxxxxx>
- Date: Sat, 16 Feb 2008 12:52:30 -0800 (PST)
On Feb 16, 2:26 pm, "Todd Vargo" <tlva...@xxxxxxxxxxxxxx> wrote:
Tom Lavedas wrote:
Todd Vargo wrote:
::BatchRename.cmd
@echo off
for /f %%i in ('dir /b') do call :rename "%%i"
goto :EOF
:rename
set NewName=%~n1
set NewName=0%NewName:Picture =%
set NewName=%NewName:~-2%
rename %1 %rolldate%%newname%%~x1
goto :EOF
Todd, I believe you were a bit hasty in your response. The double
quotes are only part of the answer. I think you were misled by the
unnecessary use of the 'dir /b' and the /F switch. The argument to
the rename subroutine will already be parsed at the space before it
arrives as a parameter to the subroutine call.
Good point. I forgot to remove /f and replace 'dir /b' with "Picture *.jpg"
to prevent reprocessing the same files (which will likely occur using
*.jpg).
--
Todd Vargo
(Post questions to group only. Remove "z" to email personal messages)
Right. A point that I missed.
Tom Lavedas
===========
.
- References:
- The killer space!
- From: sand
- Re: The killer space!
- From: Todd Vargo
- Re: The killer space!
- From: Tom Lavedas
- Re: The killer space!
- From: Todd Vargo
- The killer space!
- Prev by Date: Re: The killer space!
- Next by Date: Re: Eric Lippert's latest postings...
- Previous by thread: Re: The killer space!
- Next by thread: variable in RegEx
- Index(es):
Relevant Pages
|