Re: The killer space!
- From: "Todd Vargo" <tlvargo@xxxxxxxxxxxxxx>
- Date: Sat, 16 Feb 2008 14:26:58 -0500
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)
.
- Follow-Ups:
- Re: The killer space!
- From: Tom Lavedas
- Re: The killer space!
- References:
- The killer space!
- From: sand
- Re: The killer space!
- From: Todd Vargo
- Re: The killer space!
- From: Tom Lavedas
- The killer space!
- Prev by Date: RE: script doesn't run under xp
- Next by Date: Re: The killer space!
- Previous by thread: Re: The killer space!
- Next by thread: Re: The killer space!
- Index(es):
Relevant Pages
|