On Windows 7 machines, sometimes a window service behaves unexpectedly and does not starts giving an error:

Error 13: The data is invalid”

Firstly use the process monitoring tool to see any Access denied errors, on files folders and registry keys. Most of the cases arise due to some file/keys/folder restrictions that can be captured using the tool. Here is the resolution for few services :

For IIS:

Error in the event logs :   

                The Windows Process Activation Service encountered an error trying to read configuration data from file ‘\\?\C:\Windows\system32\inetsrv\config\applicationHost.config’, line number ’0′.  The error message is: ‘Configuration file is not well-formed XML’.  The data field contains the error number.

When any changes are made on web applications in IIS it creates a backup of the applicationHost.config file in c:\inetpub\history.  Just copy the file from the history and put it into c:\windows\system32\inetsrv\config.




Event Log service:

            On using process monitoring tool, you will see Access denied error on registry keys. Giving full permission and cleaning this folder %SystemRoot%\System32\Winevt\Logs will solve the issue.

WMI service:

                Rebuilding the WMI repository will solve the issue http://blogs.technet.com/b/askperf/archive/2009/04/13/wmi-rebuilding-the-wmi-repository.aspx




Server Service:

            Sometimes server service can terminate with Error 13 : Data is invalid. This is because of security restrictions on HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer key. OR security restriction on service using group policies.

Process monitoring tool is available on : https://docs.microsoft.com/en-us/sysinternals/downloads/procmon