I managed to workaround the problem, and even have a better handling of .dwg
files behaviour by changing the way I install the file association.
Instead of modifying HKEY_CLASSES_ROOT\.dwg
, I just leave that alone and modify HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.dwg\UserChoice
instead.
This overrides the default association for .dwg
files, and AutoCAD won't even bother.
If anyone is curious, this is what I'm doing:
AutoCAD_2006_2014.reg
Windows Registry Editor Version 5.00
[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.dwg]
[-HKEY_CLASSES_ROOT\AutoCAD.Drawing.Multi]
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.dwg\UserChoice]
"Progid"="AutoCAD.Drawing.Multi"
[HKEY_CLASSES_ROOT\AutoCAD.Drawing.Multi]
@="Open with AutoCAD 2014 / 2006"
[HKEY_CLASSES_ROOT\AutoCAD.Drawing.Multi\DefaultIcon]
@="C:\\Program Files\\Autodesk\\AutoCAD 2014\\en-US\\acadficn.dll,49"
[HKEY_CLASSES_ROOT\AutoCAD.Drawing.Multi\shell]
@="Open_with_AutoCAD_2014"
[HKEY_CLASSES_ROOT\AutoCAD.Drawing.Multi\shell\Open_with_AutoCAD_2006]
@="Open with AutoCAD 2006"
[HKEY_CLASSES_ROOT\AutoCAD.Drawing.Multi\shell\Open_with_AutoCAD_2006\command]
@="\"C:\\Program Files (x86)\\AutoCAD 2006\\acad.exe\" \"%1\""
[HKEY_CLASSES_ROOT\AutoCAD.Drawing.Multi\shell\Open_with_AutoCAD_2006\ddeexec]
@="[open(\"%1\")]"
[HKEY_CLASSES_ROOT\AutoCAD.Drawing.Multi\shell\Open_with_AutoCAD_2006\ddeexec\Application]
@="AutoCAD.r16.DDE"
[HKEY_CLASSES_ROOT\AutoCAD.Drawing.Multi\shell\Open_with_AutoCAD_2006\ddeexec\Topic]
@="System"
[HKEY_CLASSES_ROOT\AutoCAD.Drawing.Multi\shell\Open_with_AutoCAD_2014]
@="Open with AutoCAD 2014"
[HKEY_CLASSES_ROOT\AutoCAD.Drawing.Multi\shell\Open_with_AutoCAD_2014\command]
@="\"C:\\Program Files\\Autodesk\\AutoCAD 2014\\acad.exe\" \"%1\""
[HKEY_CLASSES_ROOT\AutoCAD.Drawing.Multi\shell\Open_with_AutoCAD_2014\ddeexec]
@="[open(\"%1\")]"
[HKEY_CLASSES_ROOT\AutoCAD.Drawing.Multi\shell\Open_with_AutoCAD_2014\ddeexec\Application]
@="AutoCAD.r19.DDE"
[HKEY_CLASSES_ROOT\AutoCAD.Drawing.Multi\shell\Open_with_AutoCAD_2014\ddeexec\Topic]
@="System"
This allows both AutoCAD 2006 and AutoCAD 2014 to coexist on the same system, AutoCAD 2014 being the default one, and you can right-click any .dwg
file and open with AutoCAD 2006.
This was created because some of our architects are relutant to upgrade from AutoCAD 2006, and some of our scripts are only compatible with AutoCAD 2006.
This does not answer the fundamental question though, so I'm not accepting it as answer. How to reset the DWG association setting on AutoCAD remains a mystery.