Solved Xml file edit context menu error

zdzdz

New member
Local time
7:39 PM
Messages
14
Hello,
My PC has Windows 7 Ultimate x64

Here is my problem:

I want to edit an xml file by right clicking on it and choosing "Edit" from the context menu.

uZEFbjK.jpg


What I expect is Notepad to open the xml file. But in fact there is an error:

This file does not have a program associated with it for performing this action. Please install a program or, if one is already installed, create an association in the Default Programs control panel.

OaBhKdV.jpg


The Default Program chosen to open and edit xml files is MS XML Editor. As I want it to be.

Here is my registry:

HKCR\.xml
Code:
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.xml]
@="xmlfile"
"Content Type"="text/xml"
"PerceivedType"="text"

[HKEY_CLASSES_ROOT\.xml\OpenWithList]

[HKEY_CLASSES_ROOT\.xml\OpenWithList\vsta.exe]
@=""

[HKEY_CLASSES_ROOT\.xml\OpenWithList\winword.exe]
@=""

[HKEY_CLASSES_ROOT\.xml\OpenWithProgids]
"InfoPath.Document.3"=""
"VSTA.xml.8.0"=""
"XamarinStudio.5.1.4.0"=""

[HKEY_CLASSES_ROOT\.xml\PersistentHandler]
@="{7E9D8D44-6926-426F-AA2B-217A819A5CCE}"
HKCR\xmlfile
Code:
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\xmlfile]
@="XML Document"
"EditFlags"=hex:00,00,01,00
"FriendlyTypeName"=hex(2):40,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,\
  00,6f,00,6f,00,74,00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,\
  32,00,5c,00,6d,00,73,00,78,00,6d,00,6c,00,33,00,72,00,2e,00,64,00,6c,00,6c,\
  00,2c,00,2d,00,31,00,00,00

[HKEY_CLASSES_ROOT\xmlfile\BrowseInPlace]
@=""

[HKEY_CLASSES_ROOT\xmlfile\CLSID]
@="{48123BC4-99D9-11D1-A6B3-00C04FD91555}"

[HKEY_CLASSES_ROOT\xmlfile\DefaultIcon]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
  00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,6d,00,73,00,\
  78,00,6d,00,6c,00,33,00,2e,00,64,00,6c,00,6c,00,2c,00,30,00,00,00

[HKEY_CLASSES_ROOT\xmlfile\shell]
@="open"

[HKEY_CLASSES_ROOT\xmlfile\shell\edit]

[HKEY_CLASSES_ROOT\xmlfile\shell\edit\command]
@="\"C:\\Program Files\\Common Files\\Microsoft Shared\\OFFICE14\\MSOXMLED.EXE\" /verb edit \"%1\""

[HKEY_CLASSES_ROOT\xmlfile\shell\Open]

[HKEY_CLASSES_ROOT\xmlfile\shell\Open\command]
@="\"C:\\Program Files\\Common Files\\Microsoft Shared\\OFFICE14\\MSOXMLED.EXE\" /verb open \"%1\""

[HKEY_CLASSES_ROOT\xmlfile\shell\Open\ddeexec]
@="\"file:%1\",,-1,,,,,"

[HKEY_CLASSES_ROOT\xmlfile\shell\Open\ddeexec\application]
@="IExplore"

[HKEY_CLASSES_ROOT\xmlfile\shell\Open\ddeexec\topic]
@="WWW_OpenURL"

[HKEY_CLASSES_ROOT\xmlfile\ShellEx]

[HKEY_CLASSES_ROOT\xmlfile\ShellEx\IconHandler]
@="{AB968F1E-E20B-403A-9EB8-72EB0EB6797E}"
Open and Edit menues are as I want them:
Code:
[HKEY_CLASSES_ROOT\xmlfile\shell\edit\command]
@="\"C:\\Program Files\\Common Files\\Microsoft Shared\\OFFICE14\\MSOXMLED.EXE\" /verb edit \"%1\""

[HKEY_CLASSES_ROOT\xmlfile\shell\Open\command]
@="\"C:\\Program Files\\Common Files\\Microsoft Shared\\OFFICE14\\MSOXMLED.EXE\" /verb open \"%1\""
I want MSOXMLED.exe to check the xml file for specific headers and if any to open them with the specified program. And likewise if there are no headers to use the default programs.

It looks like if there are no headers (<?mso-application progid="something"?>) MSOXMLED.exe chooses the default program from XEV.GenericApp:

Code:
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\XEV.GenericApp]
"EditFlags"=hex:01,00,00,00

[HKEY_CLASSES_ROOT\XEV.GenericApp\DefaultIcon]
@="C:\\Windows\\SysWow64\\msxml3.dll,0"

[HKEY_CLASSES_ROOT\XEV.GenericApp\shell]

[HKEY_CLASSES_ROOT\XEV.GenericApp\shell\open]

[HKEY_CLASSES_ROOT\XEV.GenericApp\shell\open\command]
@="\"C:\\Program Files (x86)\\Internet Explorer\\IEXPLORE.EXE\" -nohome"

[HKEY_CLASSES_ROOT\XEV.GenericApp\shell\open\ddeexec]
@="\"file:%1\",,-1,,,,,"

[HKEY_CLASSES_ROOT\XEV.GenericApp\shell\open\ddeexec\application]
@="IExplore"

[HKEY_CLASSES_ROOT\XEV.GenericApp\shell\open\ddeexec\topic]
@="WWW_OpenURL"
This works when I choose Open from the context menu.
MSOXMLED.exe /verb open leads to XEV.GenericApp's Open command and the xml file is being opened with IE as specified.

But when I choose Edit from the context menu, there is an error for file association.

I have another PC with Win7 Ultimate x64. When click Edit from the context menu the xml file is opened with Notepad as I wish. No errors. I checked these registry keys there and the were the same as mine.

I found a workaround. If I create a key named Edit with command ["C:\Windows\Notepad.exe" "%1"] under XEV.GenericApp, then everything works as I want it. Because the command under xmlfile\shell\edit is:
...MSOXMLED.exe /verb edit
Code:
[HKEY_CLASSES_ROOT\XEV.GenericApp\shell\edit]

[HKEY_CLASSES_ROOT\XEV.GenericApp\shell\edit\command]
@="\"C:\\Windows\\NOTEPAD.EXE\" \"%1\""

But the problem is I don't want such a workaround.
I want to know why it's not working on my PC but on another it is finctioning just fine.

Perhaps there are other registry keys for default opening of xml files? Can somebody help me?
 
Last edited:

My Computer

Computer type
PC/Desktop
OS
Windows 7 Ultimate 64bit
CPU
Intel Dual Core E5200
Motherboard
MSI MS-7507
Memory
2x2GB DDR2 667Mhz Kingston
Graphics Card(s)
Palit GT 240
Hard Drives
500GB Seagate
Antivirus
ESET Smart Security
Browser
Google Chrome

My Computer

Computer type
PC/Desktop
OS
Windows 10 Home x64
CPU
INTEL Core i5-750 Quad-Core 3.37GHz
Motherboard
ASUS P7P55D
Memory
HyperX Fury Black Series 8GB (2 x 4GB) 1866Mhz
Graphics Card(s)
EVGA GeForce GTX 750 Superclocked 1GB 128-Bit GDDR5
Monitor(s) Displays
LG 32MA68HY 32" IPS
Screen Resolution
1920 x 1080
Hard Drives
Samsung 840 Evo 120GB, SEAGATE 500GB Barracuda® 7200.12, SATA 3 Gb/s, 7200 RPM, 16MB cache
PSU
ANTEC TruePower New TP-550, 80 PLUS, 550W
Case
ANTEC Three Hundred Illusion
Cooling
COOLER MASTER Hyper 212 Plus, 4 x 120mm 1 x 140mm Noctua's
Internet Speed
85 + Mbps
Antivirus
Avast
Browser
Vivaldi
I tried that. It doesn't help. These default keys are basicaly the same as mine.

Edit options results in error only when MS XML Editor is chosen as default opening program for xml files. When I choose other default program like IE, Notepad, Wordpad, etc. then EDIT menu opens notepad. Strange.
 

My Computer

Computer type
PC/Desktop
OS
Windows 7 Ultimate 64bit
CPU
Intel Dual Core E5200
Motherboard
MSI MS-7507
Memory
2x2GB DDR2 667Mhz Kingston
Graphics Card(s)
Palit GT 240
Hard Drives
500GB Seagate
Antivirus
ESET Smart Security
Browser
Google Chrome
Miraculously everything turned out well. I don't know how but suddenly the Edit option in the context menu works like charm. The default program is MS XML Editor. XML opens with IE and it's edited with Notepad.

I don't know how this happened. I just started to choose different default programs one by one. And suddenly Edit works. Windows registry is big mystery for me.
 

My Computer

Computer type
PC/Desktop
OS
Windows 7 Ultimate 64bit
CPU
Intel Dual Core E5200
Motherboard
MSI MS-7507
Memory
2x2GB DDR2 667Mhz Kingston
Graphics Card(s)
Palit GT 240
Hard Drives
500GB Seagate
Antivirus
ESET Smart Security
Browser
Google Chrome
Lol, sometimes you just have to kick it :p Glad you got it working ;)

A Guy
 

My Computer

Computer type
PC/Desktop
OS
Windows 10 Home x64
CPU
INTEL Core i5-750 Quad-Core 3.37GHz
Motherboard
ASUS P7P55D
Memory
HyperX Fury Black Series 8GB (2 x 4GB) 1866Mhz
Graphics Card(s)
EVGA GeForce GTX 750 Superclocked 1GB 128-Bit GDDR5
Monitor(s) Displays
LG 32MA68HY 32" IPS
Screen Resolution
1920 x 1080
Hard Drives
Samsung 840 Evo 120GB, SEAGATE 500GB Barracuda® 7200.12, SATA 3 Gb/s, 7200 RPM, 16MB cache
PSU
ANTEC TruePower New TP-550, 80 PLUS, 550W
Case
ANTEC Three Hundred Illusion
Cooling
COOLER MASTER Hyper 212 Plus, 4 x 120mm 1 x 140mm Noctua's
Internet Speed
85 + Mbps
Antivirus
Avast
Browser
Vivaldi
I noticed similar issue recently and cured it with a repair install of Microsoft Office 2007 Pro.

Repair found corrupt registry entries.

XML files now go to Notepad when EDIT button is Right-Clicked.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dell XPS 600
OS
Windows 7 Ultimate x64
CPU
Intel Pentium D 3.20 GHz
Motherboard
Foxconn
Memory
8GB
Graphics Card(s)
nvidia
Hard Drives
2TB Toshiba
Antivirus
MSE
Browser
IE 10 and Chrome
In case anyone runs into this again, if I'm not mistaken you have to fix HKCR\SystemFileAssociations\document\shell\edit\command, not HKCR\xmlfile. That is because by default xml files are considered "text". I learned that much while attempting and failing to assign a special Edit with Notepad++ context item. By default Notepad++'s context item is assigned to HKCR\*, but I'm assigning it to file associations of my choosing and xml is the only one I'm not having any luck with. I know for sure you can fix the problem this thread was about though.
 
Last edited:

My Computer

Computer Manufacturer/Model Number
Wat Racing Development
OS
Windows 7 Ultimate x64
CPU
Q9450
Motherboard
Asus Rampage
Memory
8 GB G.Skill
Graphics Card(s)
NVIDIA 8800 GTX
Sound Card
Auzen X-Fi Prelude
Monitor(s) Displays
3x Sony FW900
Hard Drives
Intel X25-M SSD - 160 GB
2x WD Caviar Black WD2001FASS - 2 TB
PSU
Ultra X3 1000W
Case
Silverstone TJ-09
Cooling
Thermalright Ultra-120 Extreme
Back
Top