Sign in to follow this  
Followers 0
Alcoholic

File association Question

4 posts in this topic

Hi everyone, is there a way to associate a file type with

a program written in autoit?

I want to open .log files using a text editor written in autoit,

is that possible?

Thanks...


I FEEL DEVOTION

Share this post


Link to post
Share on other sites



Hi.

Hi everyone, is there a way to associate a file type with

a program written in autoit?

I want to open .log files using a text editor written in autoit,

is that possible?

Thanks...

Please read the FAQ (Sticky Posting, topmost in this forum) [1]

Regards, Rudi.

[1] Q16. How can I register a file type with my program [or] How can I make files with a certain extension open in my program?


Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Share this post


Link to post
Share on other sites

@all

Maybe this can get you going

_FiletypeAssociation('.test', 'test', 'notepad "%1"', 'test description')

Func _FiletypeAssociation($extension, $type, $program, $description = '')

    $exitcode = RunWait(@ComSpec & ' /c ftype ' & $type & '=' & $program & _
             ' && assoc ' & $extension & '=' & $type, '', @SW_HIDE)
    If $description And Not $exitcode Then
        Return RegWrite('HKCR\' & $type, '', 'Reg_sz', $description)
    EndIf
    Return Not $exitcode
EndFunc

regards

ptrex

Share this post


Link to post
Share on other sites

@all

Maybe this can get you going

_FiletypeAssociation('.test', 'test', 'notepad "%1"', 'test description')

Func _FiletypeAssociation($extension, $type, $program, $description = '')

    $exitcode = RunWait(@ComSpec & ' /c ftype ' & $type & '=' & $program & _
             ' && assoc ' & $extension & '=' & $type, '', @SW_HIDE)
    If $description And Not $exitcode Then
        Return RegWrite('HKCR\' & $type, '', 'Reg_sz', $description)
    EndIf
    Return Not $exitcode
EndFunc

regards

ptrex

Handy! Thanks, I will have good usage of this!

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