Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Getting extended File infos of a File

32 views
Skip to first unread message

Nijazi Halimaji

unread,
Oct 27, 2004, 3:46:15 AM10/27/04
to
Hi everybody

I like to get the information "Picture captured at:" of a jpg file (created
with a digicam). This info I can get under file properties -> extended file
informations. There I have this Info "Picture captured at:".

So my question is: How can I get with VBS these extended file info values?

Thanks for every help!

Nijazi Halimaji


Torgeir Bakken (MVP)

unread,
Oct 27, 2004, 6:00:57 AM10/27/04
to
Nijazi Halimaji wrote:

> Hi everybody
>
> I like to get the information "Picture captured at:" of a jpg file (created
> with a digicam). This info I can get under file properties -> extended file
> informations. There I have this Info "Picture captured at:".
>
> So my question is: How can I get with VBS these extended file info values?

Hi

For Windows XP and beyond:

Retrieving Extended File Properties
http://www.microsoft.com/resources/documentation/windows/2000/server/scriptguide/en-us/sas_fil_lunl.mspx

I would guess that "Date Picture Taken" is what you see as
"Picture captured at:"

In a command prompt, redirect output to file like this:

cscript.exe c:\scripts\file.vbs >file.txt


Some more examples:


Enumerate all properties for one file only:

'--------------------8<----------------------

strFolder = "D:\Pictures"
strFile = "IMG_1556.JPG"

Set objShellApp = CreateObject("Shell.Application")
Set objFolder = objShellApp.NameSpace(strFolder)
Set objFolderItem = objFolder.ParseName(strFile)

Dim arrHeaders(39)
For i = 0 To Ubound(arrHeaders)
arrHeaders(i) = objFolder.GetDetailsOf(objFolder.Items, i)
Next

For i = 0 To Ubound(arrHeaders)
Wscript.Echo i & vbtab & arrHeaders(i) _
& ": " & objFolder.GetDetailsOf(objFolderItem, i)
Next

'--------------------8<----------------------

Display only chosen properties:

'--------------------8<----------------------
strFolder = "D:\Pictures"
strFile = "IMG_1556.JPG"

Set objShellApp = CreateObject("Shell.Application")
Set objFolder = objShellApp.NameSpace(strFolder)
Set objFolderItem = objFolder.ParseName(strFile)

strSize = objFolder.GetDetailsOf(objFolderItem, 1)
WScript.Echo "Size: " & strSize

strDatePT = objFolder.GetDetailsOf(objFolderItem, 25)
WScript.Echo "Date Picture Taken: " & strDatePT
'--------------------8<----------------------

--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx

ljb

unread,
Oct 27, 2004, 2:18:42 PM10/27/04
to

"Torgeir Bakken (MVP)" <Torgeir.B...@hydro.com> wrote in message
news:O3rWCwA...@TK2MSFTNGP15.phx.gbl...

> Nijazi Halimaji wrote:
>
> > Hi everybody
> >
> > I like to get the information "Picture captured at:" of a jpg file
(created
> > with a digicam). This info I can get under file properties -> extended
file
> > informations. There I have this Info "Picture captured at:".
> >
> > So my question is: How can I get with VBS these extended file info
values?
> Hi
>
> For Windows XP and beyond:
>
> Retrieving Extended File Properties
>
http://www.microsoft.com/resources/documentation/windows/2000/server/scriptguide/en-us/sas_fil_lunl.mspx
>
> I would guess that "Date Picture Taken" is what you see as
> "Picture captured at:"

I liked your examples. Now how would I update this information in vbscript?
I have hundreds of images without descriptions. In a database I currently
have all my descriptions, subjects, keywords and photo dates. I don't need
help with the database part just how to write the properties.

thanks
LJB


0 new messages