Sign in to follow this  
Followers 0
ptrex

File Type Associations

2 posts in this topic

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

Share this post


Link to post
Share on other sites



haha, nice! <_<

Share this post


Link to post
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
Sign in to follow this  
Followers 0