Batch file (.bat) error

Post any Bulk Rename Utility support requirements here. Open to all registered users.

Batch file (.bat) error

Postby jamestyler58 » Wed May 19, 2010 2:24 pm

Hi,

I have created a command line to rename some files and it works great.
I put the command line into a bat file and it doesn't

The command is
BRC32.exe /PATTERN:"*.TXT" /APPENDDATE:C:S:::10:"%d%b%Y" /EXECUTE

in a cmd window this returns YAEPF19MAY2010.TXT
in a bat file this makes no changes, but the data on screen shows YAEPFbU.TXT

can anyone point out what I have done wrong?

Thanks
James
jamestyler58
 
Posts: 2
Joined: Wed May 19, 2010 2:18 pm

Re: Batch file (.bat) error

Postby jamestyler58 » Wed May 19, 2010 3:01 pm

Sorry, I managed it on my own.

FYI i needed a double % on the command, so %%d etc.

Thanks
James
jamestyler58
 
Posts: 2
Joined: Wed May 19, 2010 2:18 pm

Re: Batch file (.bat) error

Postby Stefan » Wed May 19, 2010 3:15 pm

Hi James, welcome.

jamestyler58 wrote:Hi,

I have created a command line to rename some files and it works great.
I put the command line into a bat file and it doesn't

The command is
BRC32.exe /PATTERN:"*.TXT" /APPENDDATE:C:S:::10:"%d%b%Y" /EXECUTE

in a cmd window this returns YAEPF19MAY2010.TXT
in a bat file this makes no changes, but the data on screen shows YAEPFbU.TXT

can anyone point out what I have done wrong?

Thanks
James


Write PAUSE as last command in your batch file, then you will see what happens:
the "%" sign is an DOS-Batch meta-char an thus have to be escaped by an another %
That means: double the %'s to %%

Other way your real command from batch would look like:
BRC32.exe /PATTERN:"*.TXT" /APPENDDATE:C:S:::10:"dbY" /EXECUTE




Try this batch:

BRC.cmd
Code: Select all
@ECHO OFF
BRC32.exe /PATTERN:"*.TXT" /APPENDDATE:C:S:::10:"%%d%%b%%Y" /EXECUTE
PASUE


HTH? :D




And, BTW, i have seen that PATTERN is case sensitive?
/PATTERN:"*.TXT" didn't works for my "test.txt" files... (but for "test2.TXT")... i have to use /PATTERN:"*.txt" ?
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU


Return to BRU Support