The application failed to initialize properly (0xc0000022).

I started receiving the error The application failed to initialize properly (0xc0000022) on my primary development machine (running Windows XP SP3) whenever I tried to launch select applications (cmd.exe, SecureCRT, runas.exe, mmc.exe, etc).  It had been a while since my last reboot and I had installed a some new programs and the latest Windows Updates, so I assumed it was related to that.

One reboot later and some applications (cmd.exe) would launch, but many others still wouldn't.  A quick Google search showed that this was often related to the permissions being incorrect on some core system DLLs.  No problem, find the DLLs, right click, properties.  And the Security tab was missing.  The most common cause of this is that Simple File Sharing is enabled.  Except it wasn't. I toggled that off/on, and still the Security tab was missing.  Enter CACLS – a command line utility to view/edit file ACLs.

Fixing Windows DLL Permissions

Windows is trying to load a DLL that the application depends on, and something is preventing it.  Given that the Security tab was missing from an Explorer Properties window, my guess would be that a DLL that controls ACLs and permissions had restrictive or corrupted permissions.

The CACLS commands below modify all .dll and .ocx files inside the system32 directory and grant members of the Users group Read access.

  • As an Administrator open a command prompt – Start > Run > cmd
  • Inside the command prompt window type:
    CACLS %systemroot%\System32\*.dll /E /G BUILTIN\Users:R
    And press Enter.  This will take a minute or so and will display a slew of processed file: C:\WINDOWS\System32\blah.dll messages.
  • Then type:
    CACLS %systemroot%\System32\*.ocx /E /G BUILTIN\Users:R
    And press Enter.

After both commands completed I was immediately able to launch all of the previously non-functional applications.

Application DLL Dependencies

Here are the top-level dependencies for some of the applications that were not working properly.

The reason I chose to modify all of the DLLs was pure laziness – SecureCRT has 135 DLLs it depends on, VMware Workstation has 157, cmd.exe has 130.  If you are aiming for precision use the excellent Dependency Walker and load each application.  Copy the DLLs with full paths, remove anything outside of %systemroot%\system32 and then find the common shared DLLs from list.  Use the same CACLS command (CACLS %systemroot%\System32\FILENAME /E /G BUILTIN\Users:R) for each of those files.

 

Tags: , ,

18 Responses to “The application failed to initialize properly (0xc0000022).”

  1. Brent Says:

    I had this same exact problem today on 2 machines. I rebooted them for the first time since updates were applied (August's). Running the commands seems to fix the problems, but it came back on its own w/o a reboot of the machine. Sometimes the security tab is missing and sometimes its not. Have you had anymore problems with your machine?

  2. scotty Says:

    Many thanks for this – I got hit with this on one machine today
    Although the solution is out there on a number of other sites this one seemed to lay it out (and have exactly the same symptoms as me) well
    Thanks

    Regards

  3. Brent Says:

    My issue was caused by an update to NOD32 AV. Signature version 3435 caused the entire issue that had the exact same symptoms as this.

  4. Scotty Says:

    ..interesting…
    We use NOD as well – at 3437 presently, have got a lot of machines out there with this installed on, hope we've not a big problem on the way..

  5. Corey Says:

    Interesting. I'm running NOD32 also, I didn't think to check that. About an hour after I posted this the problem reoccurred, and then the power supply in my computer died. I replaced that and when I rebooted the problem was gone. I wasn't paying attention, but it's entirely possible that there was a NOD32 update that was automatically applied when I booted up on the new PSU.

  6. Scotty Says:

    We got this reply from Eset support:

    "There was a problem with update 3435 and it actually got pulled from the servers, it appeared to affect users trying to logon to a network environment, this was fixed with 3436 and only seemed to affect north America as they were the only ones working in that kind of environment so we did not see the same issues in the rest of the world as such.

    It also seem to only affect v3.0.657, you should make sure that you have the latest build of the software installed currently v3.0.672
    "

  7. Scotty Says:

    Doesnt look like a good week for Eset – they released a firewall update last night which has broken one of our custom in-house apps.
    Not related to this issue, but the reply from Eset was;

    "We released a firewall update overnight and it does seem to have caused some issues. Our developers will be releasing a FIX shortly so if you can bear with us the fix should hopefully sort your issues out.

    "

  8. Pedro Antonio Says:

    I had the same problem. After I read the comment about Nod32 I desintalled all antiviruses that I had in my computer. Then I can run the programs, specially Word, Excel and Powerpoint. Me too did this post: http://foro.noticias3d.com/vbulletin/showthread.php?t=203069. Thanks for all.

  9. Paige Says:

    I have a vista home premium system and tried this fix… my system will not run windows internet explorer. Any other suggestions besides me throwing my laptop out the window>>>

  10. Johnny Anderson Says:

    I got this (0xc0000022) msg every time I click on Safari, IE or Firefox. I can go on line with Net Zero BUT no browser opens up. I tried the above suggestion in the RUN box and the errors are still coming up. All of this has come onto my desktop since I did a lot of windows updates last week, including service pack 3.

    If anyone has any suggestions, please email me a johnnyboy1@rocketmail.com as I cannot get on the Net with my desktop right now. I also tried Regcure and got nowhere with that either, thanks for anyone's help out there.

  11. class mates Says:

    I haven't had any problems since I started running Linux almost eight years ago. Try it, you might start to enjoy it.

  12. GRACE Says:

    My computer recognize the command i insert ie CACLS %systemroot%\System32\*.dll /E /G BUILTIN\Users:R
    What should i do?

  13. Pablo G Martinez Says:

    Thank you very much!!!! It was the solution for me. :D

  14. APP Blog » Blog Archive » ruby.exe - The application failed to initialize properly (0xc0000022). Says:

    [...] judicious Googling found this entry (thanks Corey!) on the possibility that Windows DLL permissions may be to blame. So I opened a zsh [...]

  15. Ben Feese Says:

    I tried this CACLS fix (also offered in http://www.tech-pro.net/howto_015.html ).For me, it does not work. I get the same error msg as before (always repeated twice).I am running Windows XP, SP3.

  16. Michael Ash Says:

    I have the same problem, no idea where it came from but the CACLS fix does not work and now when I turn my computer on it just gives me the desktop background and NOTHING else comes up. Infuriating. Strangely, it all seems to have happened since I allowed another user to access my computer at the start up screen.

  17. Christopher Byram Says:

    I started getting this error following an upgrade of PC-DMIS from version 4.2 to Version 4.4 (PC-DMIS CAD 2009). When logged in as administrator, it worked fine. When a user logged in with Domain User or local Power User privileges, I would get this error every single time I tried to launch PC-DMIS. Using the commands you provided fixed my problem and everything seems to be working normally again. Thanks for posting this info on the web!

  18. Gary Says:

    Please note. This will hurt Windows 7

    I had this error when booting into normal mode. I could boot into safe mode. I know these directions were made for XP. I couldn't figure out any other way to resolve it. Even after calling Microsoft. After following these instructions I couldn't boot into either normal mode or safe mode.

Leave a Reply


© 2007-2010, Corey Gilmore | Posts RSS Feed | Comments RSS Feed | Contact

 

The views expressed on these pages are mine alone and not those of any past or present employer. All information presented on this site was obtained lawfully and not through disclosure under the terms of an NDA.