1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Need to get a files extended attributes in my VBS ouput

Discussion in 'Software Development' started by StumpedTechy, Feb 14, 2013.

Thread Status:
Not open for further replies.
  1. StumpedTechy

    StumpedTechy Thread Starter

    Joined:
    Jul 7, 2004
    Messages:
    7,234
    Here is my code working flawlessly - Basically it creates file it scours all my Movie folders for just my movies (mkv files) and it returns the movie name in one column and the path in the second column.

    Now what I am also wanting to get is to know which of my movies are in what resolutions. The reason being my kids have ripped some movies very small for their iphones and a number of things I noticed the main thing to look at it the frame height and frame width (if you go in through windows you go to right click on the file, properties, details it has it listed as Frame Height and Frame Width.

    Now I found out that frame height and frame width are 283 and 285 of the file attributes.

    Code:
    Dim objFSO
    Dim ObjOutFile
     
    'Creating File System Object
    Set objFSO = CreateObject("Scripting.FileSystemObject")
     
    'Create an output file
    Set ObjOutFile = objFSO.CreateTextFile("Movie List.csv")
     
    'Writing CSV headers
    ObjOutFile.WriteLine("File Name,File Height,File Width,File Path")
    
    Set objSuperFolder = objFSO.GetFolder("Y:\")
    Call ShowSubfolders (objSuperFolder)
    
    Wscript.Echo "Finished Processing Movies."
    
    WScript.Quit 0
    
    Sub ShowSubFolders(fFolder)
        Set objFolder = objFSO.GetFolder(fFolder.Path)
        Set colFiles = objFolder.Files
        For Each objFile in colFiles
            If UCase(objFSO.GetExtensionName(objFile.name)) = "MKV" Then
    		ObjOutFile.WriteLine(ObjFile.Name & "," & ObjFile.Path)
            End If
        Next
    
        For Each Subfolder in fFolder.SubFolders
            ShowSubFolders(Subfolder)
        Next
    End Sub 
    Now I found this here -

    Code:
    getDetails = GetFileDetails("C:\Program Files (x86)\Microsoft Office\Office12","Winword.exe")
    
    
    
    Function GetFileDetails(folderName,fileName)
            On Error Resume Next
            Dim objShell
            Dim objFolder
            Dim HeaderInfoArray(34)
            
            Set objShell = CreateObject("Shell.Application")
            Set objFolder = objShell.NameSpace(folderName)
    
            If (not objFolder is nothing) Then
                For i = 0 to 34    
                    HeaderInfoArray(i) = objFolder.GetDetailsOf(objFolder.Items, i)
                Next
                Dim objFolderItem
    
                Set objFolderItem = objFolder.ParseName(fileName)
    
                If (not objFolderItem Is Nothing) then
                    Dim objInfo
                    For i = 0 To 34        
                        objInfo = objFolder.GetDetailsOf(objFolderItem, i)
                        WScript.Echo i,Space(3-Len(i)),HeaderInfoArray(i) & ":", _ 
                        Space(16-Len(HeaderInfoArray(i))),objInfo
                    Next
                End If
                
                Set objFolderItem = Nothing
            End If
            
            Set objFolder = Nothing
            Set objShell = Nothing
    And if I bump this all the way up instead of to 34 to 300 I get the details I need all the way up at property 293 and 295 for Frame Height and Frame Width.

    So since I know that I have a 293 and a 295 file detail that I am wanting to get for each mkv file on my storage is there any easy way to add in a couple lines to my existing script rather than performing a call to this script and having it vastly increase the script run time.

    basically what I am looking for is a single CSV that runs in short period of time that has not only the file name and file path I already have but also has frame height and frame width
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1089478

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice