Please enable Javascript for better experience...
VB Script: Retrieving Extended Files Properties of all files in folder, and import all attributes to Excel file
By Pranay Jha | Feb 10, 2016 | In Articles | Update: May 4, 2016 | Total Views [ 642 ]
(1 Like)

To list extended Properties of files inside folder, use below script.

Save script in any localtion, i;e C:\Script.vbs, run below command

C:\>cscript //nologo script.vbs > report.csv

In addition, depending on the OS version, the properties are in different order and there may be many more.  Win XP has 33 standard items, but Win 7 has 286 and the order of some of them differ between the two OSs.



Dim arrHeaders()
Set objShell = CreateObject("Shell.Application")Set objFolder = objShell.Namespace("D:\Database")
On error resume nextFor i = 0 to 287
  redim preserve arrHeaders(i)
  arrHeaders(i) = objFolder.GetDetailsOf(objFolder.Items, i)
  if err.number <> 0 then exit forNextOn error goto 0
wsh.echo "File Name" & "," & Join(arrHeaders, ",")
For Each strFileName in objFolder.Items
  wsh.stdout.write strFileName
  For j = 0 to i - 1
    wsh.stdout.write "," & objFolder.GetDetailsOf(strFileName, j)

Thanks for visiting here. Share this article if you found it useful.
Join Facebook Group
Like Facebook Page
Connect to twitter
Share this on Social Media

About the Author

Pranay Jha
Pranay Jha
Founder, Contributer
Follow me

facebook linkedin twitter G+ VMTN

Thank you for visiting my profile. I am Pranay Jha, bring along a total of 11+ years of extensive experience with me in Information Technology sector for organizations from small business to large enterprises, wherein my current assignment I am associated with IBM as a Technical Solution Architect for Virtualization platform. I am also an Independent blogger and founder of I can be reached via email at or Direct Message via Contact Us form.

Please SignUp/Login to comment...

Or comment as anonymous...
* Name
* Email ID
Facebook Likes