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 [ 509 ]
(1 Like)
Rate

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.

Script,...

--------------------------------------------------------------------------------------

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)
  Next
  wsh.echo
Next


Thanks for visiting here. Share this article if you found it useful.
Join Facebook Group https://www.facebook.com/groups/VMwareInsight/
Like Facebook Page https://www.facebook.com/VMwareInsight/
Connect to twitter https://twitter.com/VMwareInsight
Share this on Social Media

About the Author

Pranay Jha
Pranay Jha
Founder, Contributer VMwareInsight.com
Follow me

facebook linkedin twitter G+ VMTN

My name is Pranay Jha, working in IBM as Technical Solution Architect for Virtualization platform. I have been working in IT for near around 11 years. Passionate to get involved as an Independent blogger for my blog http://vmwareinsight.com. I am carrying few industrial certifications as VMware vExpert 2016/2017, VCIX6, VCAP6-DCD, VCAP5-DCD/DCA, VCP6-DCVVCP5-DCV, VCA-Cloud, VCE-CIA, VSP, MCSE, MCITP, MCSA(Messaging). For any query or suggestion, please connect me at pranay1988jha@gmail.com. Thanks for visiting here.

 
Please SignUp/Login to comment...

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