Jump to content

File Type Associations


ptrex
 Share

Recommended Posts

Assoc and FType

Might have been done before ?

_Assoc("au3")

Func _Assoc($Ext)
Local $sRet

    $sRet = Run(@ComSpec & " /c Assoc ." & $Ext, "", @SW_HIDE,2)

    While 1
        $line = StdoutRead($sRet,71)
        If @error Then ExitLoop
        $Assoc = StringSplit($line,"=")
        ConsoleWrite($line)
            _FType($Assoc[2])
        Return $sRet
    Wend

    While 1
        $line = StderrRead($sRet)
        If @error Then ExitLoop
        ConsoleWrite( "STDERR read: "& $line& @CR)
    Wend
EndFunc

Func _FType($Type)
Local $sRet

    $sRet = Run(@ComSpec & " /c ftype " & $Type, "", @SW_HIDE,2)

    While 1
        $line = StdoutRead($sRet,71)
        If @error Then ExitLoop

        ConsoleWrite($line)
    Wend

    While 1
        $line = StderrRead($sRet)
        If @error Then ExitLoop
        ConsoleWrite( "STDERR read: "& $line& @CR)
    Wend
EndFunc

Regards

ptrex

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...