1

I need a programmatic method to set associations as part of an installer program.

I am trying to set a file extension so that when a user double clicks on that extension it runs the associated program in this case c:\temp\test.bat

I have tried using the assoc and also the ftype commands in a .bat file but when the file .003 (just for testing purposes) it still opens the Unpacker program that was already set as the default for that extension. See image of Control Panel>Programs>Default Programs>Set Associations. If I use this interface and change the program associated as I did with 002 File then it works when I double click on test.002 it runs test.bat.

I need to include this association in an install so I need to be able to do what I can do in the GUI in a .bat file. the .bat commands assoc and ftype do not seem to make changes to the GUI in the image and also still launch Unpacker not test.batenter image description here

2
  • have you checked assoc ?
    – npocmaka
    Mar 9, 2017 at 22:07
  • the thing you need to tickle in the registry is HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.ext\OpenWithList where ext is your exenstion
    – npocmaka
    Mar 9, 2017 at 22:08

0

You must log in to answer this question.

Browse other questions tagged .