1. Home
  2. Docs
  3. Scense Embedded Scripting...
  4. Scense Native Scriptable ...
  5. File Type Associations

File Type Associations

The App-V object can be used to manipulate Microsoft Application Virtualization Applications.

The ‘Base’ object is ‘ScenseFTA’. The ScenseFTA object provides general administrative functions.

ScenseFTA

Properties Description
ScenseFTAsOnly Gets or sets the FTA filter.
True = only handle FTA’s created by Scense
False = Handle all FTA’s
It is strongly recommended to set this property to True !
FTAScope Gets or sets the scope for operating FTA’s.
0=User
1=computer
It is strongly recommended to set this property to 0 !
FileTypes Reference to the FileTypes collection
LastErrorCode Last runtime error code
LastErrorText Last runtime error Description
LastErrorInfo

 

Additional information for the last runtime error

 

Methods Description
Refresh

 

Refresh the FileTypes collection.

Sub Refresh()
RefreshShell

 

 

Force a shell-refresh in order to effectuate changes in file type associations.
The icons on the desktop may flicker while executing this Method.

Sub RefreshShell()
Create

 

 

 

 

Create or overwrite a file type association within the FTAScope.

Function Create(ByVal Extension As String, ByVal ProgID As String, ByVal Verb As String, ByVal Command As String, ByVal FriendlyName As String, ByVal FriendlyTypeName As String, ByVal FriendlyVerbName As String, ByVal ContentType As String, ByVal PerceivedType As String, ByVal ShowExt As Long, ByVal InfoTip As String, ByVal EditFlags As Long, ByVal DefaultIcon As String, ByVal DDEExec As String, ByVal DDEApplication As String, ByVal DDETopic As String, ByVal SetDefault As Boolean, ByVal OverwriteExtension As Boolean, ByVal OverwriteProgID As Boolean, ByVal OverwriteVerb As Boolean, ByVal TasksetGUID As String) As Boolean
SetDefault

 

Set the specified ProgID to be the default handler for the given extension within the FTAScope.

Function SetDefault(ByVal Extension As String, ByVal ProgID As String) As Boolean
Remove

 

 

Remove the entire file type association within the FTAScope.
(Extension and default ProgID).

Function Remove(ByVal Extension  As String) As Boolean
RemoveVerb

 

 

Remove the specified Verb from the specified Extension, within the FTAScope.
if this Verb is the last Verb in the default ProgI,D then the entire Extension will be removed.

Function RemoveVerb(ByVal Extension As String, ByVal Verb As String) As Boolean

FileType

The FileTypes collection of the ScenseFTA object consists of one or more FileType objects.

Properties Description
ContentType Content type specification for this FTA
PerceivedType Perceived type specification for this FTA
ProgID Reference to a ProgID object
Extension Specifies the extension for this FTA
OpenWithList Reference to the OpenwithList collection
OpenwithProgIDs

 

Reference to the OpenwithProgIDs collection

 

Methods Description
Remove Remove the entire FTA

ProgID

The FileType object references a ProgID object.
The OpenwithProgIDs collection of the FileType object consists of one or more ProgID objects.

Properties Description
Verbs References the Verbs collection
DefaultIcon Default Icon Path
InfoTip InfoTip text
FriendlyTypeName User friendly description of the file type
EditFlags Flag bitmap for Windows Explorer
ShowExtension Specifies how extensions should be shown
FriendlyName User friendly description
ProgID ProgID name

Verb

The Verbs collection of the ProgID object consists of one or more Verb objects.

Properties Description
DDEExec DDE Command string
DDETopic DDE topic specification
DDEApplication DDE Application specification
Command Command Line to be invoked for this verb
Name Verb name
FriendlyName User friendly verb name (may include special characters)
TasksetGUID Indicates which Taskset has generated this FTA

AlternateProgram

The OpenWithList collection of the FileType object consists of one or more AlternateProgram objects.

Properties Description
AppName Name of the Alternate Program
AppPath Default path for this Alternate Program
ExePath Path to the executable for this Alternate Program

Usage:

 

Sub Scense_Main()
    'Set the Filter and Scope
    ScenseFTA.FTAScope = 0    '0=User   1=Computer
    ScenseFTA.ScenseFTAsOnly = True
    
    'Create a handler for the .test extension
    ScenseFTA.Create ".test", _
                "TestFile1", _
                "Open", _
                "c:\windows\notepad.exe %1", _
                "Test File Friendly Name", _
                , _
                "Open this Test File with Notepad", _
                , _
                , _
                , _
                "Test File InfoTip”

    'Send a refresh command to the Windows Shell (Explorer)
    ScenseFTA.RefreshShell                
End Sub

Sub Scense_Main()
    'Set the Filter and Scope
    ScenseFTA.FTAScope = 0    '0=User   1=Computer
    ScenseFTA.ScenseFTAsOnly = True
    
    'Remove the handler for the .test extension
    ScenseFTA.RemoveVerb ".test", "open"
    ScenseFTA.Remove ".test"

    'Send a refresh command to the Windows Shell (Explorer)
    ScenseFTA.RefreshShell                
End Sub

    
Sub Scense_Main()
    Dim FT

    'Set the Filter and Scope
    ScenseFTA.FTAScope = 0    '0=User   1=Computer
    ScenseFTA.ScenseFTAsOnly = True

    'Refresh the File Types collection
    ScenseFTA.Refresh

    'Iterate through all FTA’s in the scope
    For Each FT In ScenseFTA.FileTypes
        WriteScenseLog FT.Extension
    Next
End Sub