WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Samples from Users

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Date Picture Taken


Question:

On my Windows XP system, the photos I have transferred from my Digital camera show an attribute in windows explorer called "Date Picture Taken". I would like to write a script that renames all of my photos to a name based on the date the picture was taken. I have had a quick look, but cant see an easy way to get Winbatch to read this attribute from the file.

Does anyone know how to access this attribute from Winbatch?

Answer:

Here is some code that calls the GetDetailsOf method of the Shell Object.

#DefineFunction GetDetailsOf (File,Request)
   oShell=ObjectOpen('Shell.Application')
   oFolder=oShell.Namespace(FilePath(File))
   oFolderIt=oFolder.ParseName(FileBaseName(File))
   Detail=oFolder.GetDetailsOf(oFolderIt,Request)
   ObjectClose (oShell)
Return (Detail)
#EndFunction

File='c:\test.jpg'
Details=GetDetailsOf (File,25)
Message ("Date Picture Taken",Details)
Exit

Article ID:   W16161
File Created: 2004:03:30:15:43:00
Last Updated: 2004:03:30:15:43:00