Fix VFP file associations to open files in one VFP instance

The files associated with VFP are opened in a new instance of VFP when double-clicked or 'Open' verb is executed on them. It's configured in Windows not in VFP.

To open such files in one VFP instance, save following registry update as vfpfiletypes.reg and double-click on it to modify registry for VFP9 associations.

Note: It can be applied to previous VFP version as well by changing one line that references VFP 9. That line also has to be changed if VFP installed in the folder different from default. Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Visual.FoxPro.Table\shell\open\command] @="\"C:\\Program Files\\Microsoft Visual FoxPro 9\\vfp9.exe\"" [HKEY_CLASSES_ROOT\Visual.FoxPro.Table\shell\open\ddeexec] @="open(\"%1\")" [HKEY_CLASSES_ROOT\Visual.FoxPro.Table\shell\open\ddeexec\Application] @="FoxPro" [HKEY_CLASSES_ROOT\Visual.FoxPro.Table\shell\open\ddeexec\Topic] @="System" [HKEY_CLASSES_ROOT\Visual.FoxPro.ClassLibrary\shell\open\ddeexec] @="open(\"%1\")" [HKEY_CLASSES_ROOT\Visual.FoxPro.ClassLibrary\shell\open\ddeexec\Application] @="FoxPro" [HKEY_CLASSES_ROOT\Visual.FoxPro.ClassLibrary\shell\open\ddeexec\Topic] @="System" [HKEY_CLASSES_ROOT\Visual.FoxPro.Database\shell\open\ddeexec] @="open(\"%1\")" [HKEY_CLASSES_ROOT\Visual.FoxPro.Database\shell\open\ddeexec\Application] @="FoxPro" [HKEY_CLASSES_ROOT\Visual.FoxPro.Database\shell\open\ddeexec\Topic] @="System" [HKEY_CLASSES_ROOT\Visual.FoxPro.Form\shell\open\ddeexec] @="open(\"%1\")" [HKEY_CLASSES_ROOT\Visual.FoxPro.Form\shell\open\ddeexec\Application] @="FoxPro" [HKEY_CLASSES_ROOT\Visual.FoxPro.Form\shell\open\ddeexec\Topic] @="System" [HKEY_CLASSES_ROOT\Visual.FoxPro.Label\shell\open\ddeexec] @="open(\"%1\")" [HKEY_CLASSES_ROOT\Visual.FoxPro.Label\shell\open\ddeexec\Application] @="FoxPro" [HKEY_CLASSES_ROOT\Visual.FoxPro.Label\shell\open\ddeexec\Topic] @="System" [HKEY_CLASSES_ROOT\Visual.FoxPro.Menu\shell\open\ddeexec] @="open(\"%1\")" [HKEY_CLASSES_ROOT\Visual.FoxPro.Menu\shell\open\ddeexec\Application] @="FoxPro" [HKEY_CLASSES_ROOT\Visual.FoxPro.Menu\shell\open\ddeexec\Topic] @="System" [HKEY_CLASSES_ROOT\Visual.FoxPro.Program\shell\open\ddeexec] @="open(\"%1\")" [HKEY_CLASSES_ROOT\Visual.FoxPro.Program\shell\open\ddeexec\Application] @="FoxPro" [HKEY_CLASSES_ROOT\Visual.FoxPro.Program\shell\open\ddeexec\Topic] @="System" [HKEY_CLASSES_ROOT\Visual.FoxPro.Project\shell\open\ddeexec] @="open(\"%1\")" [HKEY_CLASSES_ROOT\Visual.FoxPro.Project\shell\open\ddeexec\Application] @="FoxPro" [HKEY_CLASSES_ROOT\Visual.FoxPro.Project\shell\open\ddeexec\Topic] @="System" [HKEY_CLASSES_ROOT\Visual.FoxPro.Query\shell\open\ddeexec] @="open(\"%1\")" [HKEY_CLASSES_ROOT\Visual.FoxPro.Query\shell\open\ddeexec\Application] @="FoxPro" [HKEY_CLASSES_ROOT\Visual.FoxPro.Query\shell\open\ddeexec\Topic] @="System" [HKEY_CLASSES_ROOT\Visual.FoxPro.Report\shell\open\ddeexec] @="open(\"%1\")" [HKEY_CLASSES_ROOT\Visual.FoxPro.Report\shell\open\ddeexec\Application] @="FoxPro" [HKEY_CLASSES_ROOT\Visual.FoxPro.Report\shell\open\ddeexec\Topic] @="System"

Comments

This registry "hack" still works on Win8.1, I just used it to fix an accidental association of PRGs to Notepad.

I assume this also means, DDE is still working in Win8.1

This is great, but am wondering if there's an "undo" for this that will fix the file associations so that they'll open in multiple instances again.

Adding -SHELLOPEN to the command entry in the registry works as well, but either your approach or that one results in an open DBF (in my case), but the default folder for VFP is \Windows\System32 which requires entering "CD JustPath(dbf())" every time a file is opened if other files in that folder are also to be opened, which is the case most of the time. This is on a Windows 7 Ultimate 64-bit machine.

Any additional advice on that issue would be deeply appreciated.