Page 1 of 1

file metadata

Posted: Tue Feb 28, 2006 7:24 am
by jmail137
is there a way to extract file meta data?  for example, I would like to extract the version, company name, from a file.  these are located in the properties when you right click on a file.  I can copy and paste, but Ithere must be a way to grab this information more elegantly.  my research on the internet found media file metadat extraction tools. they cater to people with music libraries. This is probably in the realms of really knowing / manipulating a programming language to really get what I am looking for.  something of which I am new /struggling with.  are there any solutions already out there?  or is there a way to get robo task to do what I want it to do?thanks for help and suggestions.Jmm     

file metadata

Posted: Tue Feb 28, 2006 7:45 am
by jmail137
ok i found something else that will help me.  this shows a way to get what I want.  but I still don't know what to do with this code now that I have it.  any help is much appreciated. http://www.microsoft.com/technet/script ... e/sas_fil_ lunl.mspx

file metadata

Posted: Tue Feb 28, 2006 8:34 am
by Oleg
I've adapted the script for RoboTask.
See example below.

;**********************
;* RoboTask Task file *
;* Do not edit!       *
;**********************

[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|418185034
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task395"
Hide=INTEGER|0
ID=INTEGER|1524932036
Name=STRING|"extract metadata from files in selected folder"
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3

[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER

[Actions\Action1]
ActionID=STRING|"A_DIALOG_BROWSEFOLDERS"
Enabled=INTEGER|-1
Name=STRING|"Browse for Folders"
Params=FOLDER

[Actions\Action1\Params]
caption=STRING|"Select Folder"
default=STRING|"None"
filter=STRING|"Text files|*.txt|All files|*.*|"
variable=STRING|"CUR_FOLDER"

[Actions\Action2]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then"
Params=FOLDER

[Actions\Action2\Params]
case=STRING|"0"
operator=STRING|"1"
type=STRING|"0"
value1=STRING|"{cur_folder}"
value2=STRING|"none"

[Actions\Action3]
ActionID=STRING|"BASIC_SCRIPT"
Enabled=INTEGER|-1
Name=STRING|"Basic Script"
Params=FOLDER

[Actions\Action3\Params]
line00000=STRING|"' adapted script from"
line00001=STRING|"' http://www.microsoft.com/technet/script ... de/default. mspx"
line00003=STRING|"Sub Main"
line00004=STRING|"Dim arrHeaders(35)"
line00006=STRING|"Set objShell = CreateObject(""Shell.Application"")"
line00007=STRING|"s = RoboTaskApp.ExpandText(""{Cur_Folder}"")"
line00008=STRING|"Set objFolder = objShell.Namespace(s)"
line00009=STRING|"For i = 0 To 34"
line00010=STRING|"   arrHeaders(i) = objFolder.GetDetailsOf(objFolder.Items, i)"
line00011=STRING|"Next"
line00012=STRING|"For Each strFileName In objFolder.Items"
line00013=STRING|"   s = """""
line00014=STRING|"   For i = 0 To 34"
line00015=STRING|"     s = s+Str(i) & vbTab & arrHeaders(i) _"
line00016=STRING|"        & "": "" & objFolder.GetDetailsOf(strFileName, i) + vbLf"
line00017=STRING|"   Next"
line00018=STRING|"   MsgBox s"
line00019=STRING|"Next"
line00020=STRING|"End Sub"
linecount=STRING|"21"
source=STRING|"0"

[Actions\Action4]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"

[Actions\Action5]
ActionID=STRING|"A_VARIABLES_REMOVE"
Enabled=INTEGER|-1
Name=STRING|"Remove variable ""CUR_FOLDER"""
Params=FOLDER

[Actions\Action5\Params]
varname=STRING|"CUR_FOLDER"

file metadata

Posted: Tue Feb 28, 2006 11:24 am
by jmail137
wow that works for getting property information. after reviewing other links in this area I found another script that grabs other information. this info comes from WMI CIM_Datafile class.  (the stuff I really need)I am going to see if I can't cobble something together based on what you created and the new script.  thanks much for your help.  I am pretty new to creating variables and getting things to loop.  (the stuff that really fascinates me.)Thanks again for your response.Jmmthis is really a cool tool. http://www.microsoft.com/technet/script ... e/sas_fil_ lunl.mspx