From: Oleg on
Can someone tell if its possible to replace the basename of a number of .jpg
files in specified folder to match their date stamp? file.DateCreated can see
that date, but how can I actually rename the files?
Thanks!
From: Pegasus [MVP] on


"Oleg" <Oleg(a)discussions.microsoft.com> wrote in message
news:F7853854-F72F-4EB3-8899-E6D670BE6545(a)microsoft.com...
> Can someone tell if its possible to replace the basename of a number of
> .jpg
> files in specified folder to match their date stamp? file.DateCreated can
> see
> that date, but how can I actually rename the files?
> Thanks!

Yes, it is possible. Create an object oFile by using the GetFile method of
the File System Object, then specify a new name via its .Name property. You
will find full details plus examples in the downloadable help file
script56.chm.

From: Oleg on
Thanks for the feedback, i'll go through the file and try to put together all
the pieces...Another thing is that the extension differs in case, some appear
as upper, some as lower, i have no idea how to tell the script to use both...




"Pegasus [MVP]" wrote:

>
>
> "Oleg" <Oleg(a)discussions.microsoft.com> wrote in message
> news:F7853854-F72F-4EB3-8899-E6D670BE6545(a)microsoft.com...
> > Can someone tell if its possible to replace the basename of a number of
> > .jpg
> > files in specified folder to match their date stamp? file.DateCreated can
> > see
> > that date, but how can I actually rename the files?
> > Thanks!
>
> Yes, it is possible. Create an object oFile by using the GetFile method of
> the File System Object, then specify a new name via its .Name property. You
> will find full details plus examples in the downloadable help file
> script56.chm.
>
> .
>
From: Oleg on
Thanks for the feedback, i'll go through the file and try to put together all
the pieces...Another thing is that the extension differs in case, some appear
as upper, some as lower, i have no idea how to tell the script to use both...

"Pegasus [MVP]" wrote:

>
>
> "Oleg" <Oleg(a)discussions.microsoft.com> wrote in message
> news:F7853854-F72F-4EB3-8899-E6D670BE6545(a)microsoft.com...
> > Can someone tell if its possible to replace the basename of a number of
> > .jpg
> > files in specified folder to match their date stamp? file.DateCreated can
> > see
> > that date, but how can I actually rename the files?
> > Thanks!
>
> Yes, it is possible. Create an object oFile by using the GetFile method of
> the File System Object, then specify a new name via its .Name property. You
> will find full details plus examples in the downloadable help file
> script56.chm.
>
> .
>
From: Pegasus [MVP] on


"Oleg" <Oleg(a)discussions.microsoft.com> wrote in message
news:86B69D88-2CFF-4183-8EB2-EBC65896DA71(a)microsoft.com...
> Thanks for the feedback, i'll go through the file and try to put together
> all
> the pieces...Another thing is that the extension differs in case, some
> appear
> as upper, some as lower, i have no idea how to tell the script to use
> both...
>

When unsure about the case of a string, translate it to lower case, e.g.
like so:

sExt = ".jpg"
if LCase(right(oFile.Name, 4)) = sExt then . . .