WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: spl on November 02, 2024, 12:27:09 PM

Title: and while on subject of file properties
Post by: spl on November 02, 2024, 12:27:09 PM
Outside iterating Office built in properties [previous post].

more to come [unless already in Tech DB]
Title: Re: and while on subject of file properties
Post by: spl on November 04, 2024, 04:28:41 AM
Working on a suite of Get/Set functions to apply to both built in and custom properties for Office documents. Reach does exceed the grasp, but whittle down in process.
Title: Re: and while on subject of file properties
Post by: spl on November 05, 2024, 06:41:27 AM
and this does get interesting.... MSFT always had DSOFile.dll to iterate properties but issues working on 64-bit. That was compiled to 64-bit [ https://www.codeproject.com/Tips/1118708/64-Bit-Application-Cannot-Use-DSOfile ] and I downloaded, installed and tested...  below are results between DSO and script earlier posted for built in properties [both parsing the same file]. Especially note the datetimes are 1 hour off, since we just went back to standard time.... funny????
Same file selected, compare examining properties with
DSOFile.OleDocumentProperties then Built In Properties

====== DSO ==============
Title                    :
Subject                  :
Author                   : Stan Littlefield
Keywords                 :
Comments                 :
Template                 :
LastSavedBy              : Stan Littlefield
RevisionNumber           :
TotalEditTime            : 0
DateLastPrinted          :
DateCreated              : 5/4/2024 1:06:18 PM
DateLastSaved            : 5/4/2024 1:16:57 PM
PageCount                : 0
WordCount                : 0
CharacterCount           : 0
Thumbnail                :
ApplicationName          : Microsoft Excel
DocumentSecurity         : 0
Category                 :
PresentationFormat       :
ByteCount                : 0
LineCount                : 0
ParagraphCount           : 0
SlideCount               : 0
NoteCount                : 0
HiddenSlideCount         : 0
MultimediaClipCount      : 0
Manager                  :
Company                  :
CharacterCountWithSpaces : 0
SharedDocument           : False
Version                  : 16.300
DigitalSignature         :

==== Built In Properties ===========
Name                           Value                                                                                                                                                                                                                                                                                                
Keywords                                                                                                                                                                              
Number of slides               Value Not Found                                                                                                                                        
Template                                                                                                                                                                              
Creation date                  5/4/2024 2:06:18 PM                                                                                                                                    
Number of notes                Value Not Found                                                                                                                                        
Author                         Stan Littlefield                                                                                                                                       
Company                                                                                                                                                                               
Content type                                                                                                                                                                          
Number of multimedia clips     Value Not Found                                                                                                                                        
Document version                                                                                                                                                                      
Last author                    Stan Littlefield                                                                                                                                       
Format                                                                                                                                                                                
Last save time                 5/4/2024 2:16:57 PM                                                                                                                                    
Title                                                                                                                                                                                 
Subject                                                                                                                                                                               
Number of hidden Slides        Value Not Found                                                                                                                                        
Category                                                                                                                                                                              
Comments                                                                                                                                                                              
Number of lines                Value Not Found                                                                                                                                        
Number of characters           Value Not Found                                                                                                                                        
Application name               Microsoft Excel                                                                                                                                        
Manager                                                                                                                                                                               
Number of characters (with ... Value Not Found                                                                                                                                        
Content status                                                                                                                                                                        
Language                                                                                                                                                                              
Number of words                Value Not Found                                                                                                                                        
Revision number                                                                                                                                                                       
Number of paragraphs           Value Not Found                                                                                                                                        
Last print date                Value Not Found                                                                                                                                        
Total editing time             Value Not Found                                                                                                                                        
Hyperlink base                                                                                                                                                                        
Security                       0                                                                                                                                                      
Number of bytes                Value Not Found                                                                                                                                        
Number of pages                Value Not Found                                                                                                                                        
Title: Re: and while on subject of file properties
Post by: spl on November 12, 2024, 06:18:54 AM
here is a teaser.. updated my 2010 file properties enumeration from 34 items to up to 500 [should capture about 338]... data saved as .txt file set up as WB map to be used in future script(s) to enumerate specific properties for specific file types.
EDITED:

;Winbatch 2010C - Enumerate Supported File Properties by Windows Shell
;                 as Winbatch Map
;
;Original: Stan Littlefield, November 26 2010
;Updated: Stan Littlefipeld, November 12, 2024
;///////////////////////////////////////////////////////////////////////////////////////
file = "c:\temp\props.txt"
if FileExist(file) Then FileDelete(file)
propmask = ''
oShell = CreateObject("Shell.Application")
Folder = "C:\Windows"
oFolder = oShell.Namespace(Folder)
Null=ObjectType("NULL","")
For i = 0 To 400
   Prop = oFolder.GetDetailsOf(Null, i) ;pass Null to enumerate
   If Prop==Null Then Continue          ;skip if not found or reserved
   propmask=propmask:i:",":prop:@lf
Next
oFolder=0
oShell=0
propmask = 'propmask = $"':propmask:'$"'
props= propmask:@lf:"props = MapCreate(propmask,'',@lf)"
FilePut(file,props)
if FileExist(file) Then run("notepad.exe",file)

Exit
Title: Re: and while on subject of file properties
Post by: spl on November 22, 2024, 01:23:11 PM
Apologies for putting this thread out. Wanted at least a response, pro or con. I'm looking into the AI sidekick for Powershell and most of what I have contributed to WB can be easily replaced with PS, but would like to still post scripts using both, rather replied to or not