From: bob123 on
Hi

How to rename all files in a directory
changing string BLABLA to BLUBLU

Thanks in advance


From: Tom Lavedas on
On Jan 20, 3:06 pm, "bob123" <bob...(a)gmail.com> wrote:
> Hi
>
> How to rename all  files in a directory
> changing string BLABLA to BLUBLU
>
> Thanks in advance

Is this a recurring task, or just a one time thing? If it's just a
one time thing, try opening a command prompt in the desired folder and
issuing a REN command, as in ...

ren "BLABLA*.*" "BLUBLU*.*"

Otherwise doing it in VBscript is messy (unless it just accesses the
REN command via script), as in ...

strSomePath = "X:\someplace\"
strOldMask = strSomePath & "BLABLA*.*"
strNewMask = "BLUBLU*.*"

with createobject("wscript.shell")
.Run "%comspec% /c ren """ strOldMask & """ """ & strNewMask & """",
0, true
end with
wsh.echo "Done"
___________________
Tom Lavedas
From: bob123 on
OK thanks
Ididn't think ren "BLABLA*.*" "BLUBLU*.*"
could work
Thank you very much

"Tom Lavedas" <tglbatch(a)verizon.net> a �crit dans le message de news:
b1d95270-54d3-4cde-aafc-905cdc36110b(a)m4g2000vbn.googlegroups.com...
On Jan 20, 3:06 pm, "bob123" <bob...(a)gmail.com> wrote:
> Hi
>
> How to rename all files in a directory
> changing string BLABLA to BLUBLU
>
> Thanks in advance

Is this a recurring task, or just a one time thing? If it's just a
one time thing, try opening a command prompt in the desired folder and
issuing a REN command, as in ...

ren "BLABLA*.*" "BLUBLU*.*"

Otherwise doing it in VBscript is messy (unless it just accesses the
REN command via script), as in ...

strSomePath = "X:\someplace\"
strOldMask = strSomePath & "BLABLA*.*"
strNewMask = "BLUBLU*.*"

with createobject("wscript.shell")
.Run "%comspec% /c ren """ strOldMask & """ """ & strNewMask & """",
0, true
end with
wsh.echo "Done"
___________________
Tom Lavedas


From: Scott Ketelaar on
Use the name command.

Name(oldname, newname)


"bob123" <bob123(a)gmail.com> wrote in message
news:4b576cdc$0$22029$426a34cc(a)news.free.fr...
> OK thanks
> Ididn't think ren "BLABLA*.*" "BLUBLU*.*"
> could work
> Thank you very much
>
> "Tom Lavedas" <tglbatch(a)verizon.net> a �crit dans le message de news:
> b1d95270-54d3-4cde-aafc-905cdc36110b(a)m4g2000vbn.googlegroups.com...
> On Jan 20, 3:06 pm, "bob123" <bob...(a)gmail.com> wrote:
>> Hi
>>
>> How to rename all files in a directory
>> changing string BLABLA to BLUBLU
>>
>> Thanks in advance
>
> Is this a recurring task, or just a one time thing? If it's just a
> one time thing, try opening a command prompt in the desired folder and
> issuing a REN command, as in ...
>
> ren "BLABLA*.*" "BLUBLU*.*"
>
> Otherwise doing it in VBscript is messy (unless it just accesses the
> REN command via script), as in ...
>
> strSomePath = "X:\someplace\"
> strOldMask = strSomePath & "BLABLA*.*"
> strNewMask = "BLUBLU*.*"
>
> with createobject("wscript.shell")
> .Run "%comspec% /c ren """ strOldMask & """ """ & strNewMask & """",
> 0, true
> end with
> wsh.echo "Done"
> ___________________
> Tom Lavedas
>