From: bob123 on 20 Jan 2010 15:06 Hi How to rename all files in a directory changing string BLABLA to BLUBLU Thanks in advance
From: Tom Lavedas on 20 Jan 2010 15:45 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 20 Jan 2010 15:51 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 20 Jan 2010 16:46 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 >
|
Pages: 1 Prev: Find hostnames for list of IPs Next: backing up windows 7 |