Setting file-associations automatically - Microsoft Windows

This is a discussion on Setting file-associations automatically - Microsoft Windows ; Hello, I am developing an application that will require its users to select certain files through a standard file dialogue. The problem is that if if they have MS Access installed it will have created a file-association which prevents this ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: Setting file-associations automatically

  1. Setting file-associations automatically

    Hello,

    I am developing an application that will require its users to select
    certain files through a standard file dialogue. The problem is that if
    if they have MS Access installed it will have created a file-association
    which prevents this from working. So what I primarily would like is to
    have an easy way to delete this association, and with easy I mean
    something like a bat-file the user can run. Also, if someone knows, is
    there a way to then create a new association for that file-type, or to
    just change the association instead of deleting it to begin with?

    -- Erik Wikstr├Âm

  2. Re: Setting file-associations automatically

    Erik Wikstr÷m wrote:
    > Hello,
    >
    > I am developing an application that will require its users to select
    > certain files through a standard file dialogue. The problem is that if
    > if they have MS Access installed it will have created a
    > file-association which prevents this from working. So what I
    > primarily would like is to have an easy way to delete this
    > association, and with easy I mean something like a bat-file the user
    > can run. Also, if someone knows, is there a way to then create a new
    > association for that file-type, or to just change the association
    > instead of deleting it to begin with?


    I couldn't tell you precisely but the association will be in the
    registry, under the list of file types in HKCR perhaps. You could then
    create a *.reg file with the info you want so that a double click (and
    an OK) will put it in the registry in place of the other.



  3. Re: Setting file-associations automatically

    Erik Wikstr÷m wrote:
    > which prevents this from working. So what I primarily would like is to
    > have an easy way to delete this association, and with easy I mean
    > something like a bat-file the user can run. Also, if someone knows, is
    > there a way to then create a new association for that file-type, or to
    > just change the association instead of deleting it to begin with?


    It's in the registry. Your application will need to scan the registry for
    the appropriate associations, and change them appropriately (or delete them if
    this is really what you want to do.)

    Just google "windows file association registry"

    Theres a few entries in google for this, and it appears that different
    versions of Microsoft Windows use different keys. You will need to consider
    this from within your application.

    There are also various API and library functions for this. Google

    "windows file association API"

    Again, I think different versions of Microsoft Windows use different API
    interfaces, so you will need to consider this from within your application.

    Regards,

    Mark.

    --
    Mark Hobley
    393 Quinton Road West
    QUINTON
    Birmingham
    B32 1QE

    Email: markhobley at hotpop dot donottypethisbit com

    http://markhobley.yi.org/


  4. Re: Setting file-associations automatically

    =?UTF-8?B?RXJpayBXaWtzdHLDtm0=?= wrote in
    news:5bh4j.1138$R_4.762@newsb.telia.net:

    > Hello,
    >
    > I am developing an application that will require its users to select
    > certain files through a standard file dialogue. The problem is that if
    > if they have MS Access installed it will have created a file-
    > association which prevents this from working. So what I primarily
    > would like is to have an easy way to delete this association, and with
    > easy I mean something like a bat-file the user can run. Also, if
    > someone knows, is there a way to then create a new association for
    > that file-type, or to just change the association instead of deleting
    > it to begin with?
    >
    > -- Erik Wikstr├Âm


    Read the Windows help for ASSOC and FTYPE, or type ASSOC /? and FTYPE /?
    at a command prompt.

  5. Re: Setting file-associations automatically

    On 2007-12-01 21:43, Mark Blain wrote:
    > =?UTF-8?B?RXJpayBXaWtzdHLDtm0=?= wrote in
    > news:5bh4j.1138$R_4.762@newsb.telia.net:
    >
    >> Hello,
    >>
    >> I am developing an application that will require its users to select
    >> certain files through a standard file dialogue. The problem is that if
    >> if they have MS Access installed it will have created a file-
    >> association which prevents this from working. So what I primarily
    >> would like is to have an easy way to delete this association, and with
    >> easy I mean something like a bat-file the user can run. Also, if
    >> someone knows, is there a way to then create a new association for
    >> that file-type, or to just change the association instead of deleting
    >> it to begin with?
    >>

    > Read the Windows help for ASSOC and FTYPE, or type ASSOC /? and FTYPE /?
    > at a command prompt.


    Thanks, this looks like what I need.

    --
    Erik Wikstr├Âm

+ Reply to Thread