Jump to content

Recommended Posts

Posted

How do I change the program file properties details (right click on .exe file, choose properties, details). I want to change the File Version, Product Version, and Product Name. Any help will be appreciated. Thanks in advance!

  • Developers
Posted (edited)

Are you both talking about your own scripts exe's?

Load the full SciTe4AutoIt3 installer and use the #AutoIt3Wrapper directives.

Use Ctrl+F7 to easily fill out these directives.

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted

No, I would like to read the details of music files. I don't know what OP was talkin about, but I can assume it was the same as me. He actually wanted to change those values though. Although, now that I look at it again he could mean his own exe.

  • Moderators
Posted

darkjohn20,

This function will allow you to read the properties of music files, as long as they are set in the normal Windows properties slots:

#include <Array.au3>

Global $aTrack_Info[6]

; Function needs full path & name
$sPassed_File_Name = "Your_File_Path_And_Name_Here"
Read_Track_Info($sPassed_File_Name)
_ArrayDisplay($aTrack_Info)

Exit

Func Read_Track_Info($sPassed_File_Name)

    Local $iError = 0
    ; Reset info holders
    Global $aTrack_Info[6]

    If StringLower(StringRegExpReplace($sPassed_File_Name, "^.*\.", "")) = "wav" Then

        ; Set data to show wav - no properties available
        Dim $aTrack_Info[6] = ["", "Wave sound file"]

    Else

        ; Code modified from original by Simulcal & PsaltyDS

        Local $sDir_Name = StringRegExpReplace($sPassed_File_Name, "(^.*\\)(.*)", "\1")
        Local $sFile_Name = StringRegExpReplace($sPassed_File_Name, "^.*\\", "")

        Local $sDOS_Dir = FileGetShortName($sDir_Name, 1)

        Local $oShellApp = ObjCreate("shell.application")
        If IsObj($oShellApp) Then
            Local $oDir = $oShellApp.NameSpace($sDOS_Dir)
            If IsObj($oDir) Then
                Local $oFile = $oDir.Parsename($sFile_Name)
                If IsObj($oFile) Then

                    If @OSVersion = "WIN_VISTA" Then

                        $aTrack_Info[0] = $oDir.GetDetailsOf($oFile, 26) ; Track number
                        $aTrack_Info[1] = $oDir.GetDetailsOf($oFile, 21) ; Track
                        $aTrack_Info[2] = $oDir.GetDetailsOf($oFile, 14) ; Album
                        $aTrack_Info[3] = $oDir.GetDetailsOf($oFile, 13) ; Artist
                        $aTrack_Info[4] = $oDir.GetDetailsOf($oFile, 28) ; Bit Rate
                        $aTrack_Info[5] = $oDir.GetDetailsOf($oFile, 16) ; Genre

                    ElseIf @OSVersion = "WIN_XP" Then

                        $aTrack_Info[0] = $oDir.GetDetailsOf($oFile, 19) ; Track number
                        $aTrack_Info[1] = $oDir.GetDetailsOf($oFile, 10) ; Track
                        $aTrack_Info[2] = $oDir.GetDetailsOf($oFile, 17) ; Album
                        $aTrack_Info[3] = $oDir.GetDetailsOf($oFile, 16) ; Artist
                        $aTrack_Info[4] = $oDir.GetDetailsOf($oFile, 22) ; Bit Rate
                        $aTrack_Info[5] = $oDir.GetDetailsOf($oFile, 20) ; Genre

                    Else

                        $iError = 4

                    EndIf

                Else
                    $iError = 3
                EndIf
            Else
                $iError = 2
            EndIf
        Else
            $iError = 1
        EndIf

        If $iError > 0 Then
            Local $sMsg = "Could not read File Properties" & @CRLF & @CRLF & _
                    $iError & @CRLF & @CRLF & $sPassed_File_Name
            MsgBox(0, "Error", $sMsg)
        EndIf

    EndIf

EndFunc

I have no idea of the Win_7 property numbers - should you need them I am sure they are on the InterWeb somewhere. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Posted

Are you both talking about your own scripts exe's?

Load the full SciTe4AutoIt3 installer and use the #AutoIt3Wrapper directives.

Use Ctrl+F7 to easily fill out these directives.

Jos

That's what I was looking for!

Thanks!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...