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.

Make URLs clickable in Microsoft Office Communicator 2005 and 2007

I'm not a big fan of OCS for a whole pile of reasons, beginning with the inflexible, lacking UI and ending with restrictions on the specific deployment I use that force me to VPN to connect. Mostly issues I wouldn't have with Jabber.

With our configuration (and possibly by default) URLs were shown as plain text and not as clickable hyperlinks. You can enable this with a Group Policy - download the OCS Policies documentation and edit and import communicator.adm, or with a registry edit.

Changing the Registry

Registry edits are quick and easy, and I was only concerned about myself, so I took that route.
Save the code code below into a text file with a .reg suffix and import it, or right click the following link and and Save As to download .reg file to enable clickable URLs in OCS. Once the registry changes have been made or imported you will need to restart your OCS client.

Windows Registry Editor Version 5.00
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Communicator]
"EnableURL"=dword:00000001

If you'd prefer to manually make the registry changes:

  1. Open regedit.ext and navigate to: HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Communicator
  2. Create a new DWORD value called EnableURL and set the value to 1 to make the URLs clickable. Set the value to 0 to have the URLs appear as plain text.

Due Diligence

Checking in with an employee at Jabber to see if hyperlinks are enabled in MomentIM.

Good to know.

Fixing Windows Easy Transfer

I've been evaluating Tablet PCs for a few months now, and prior to returning the wonderful Motion Computing LE1700 I used the Vista Migration Wizard to backup all of my settings. In reality the only thing I really cared about was the handwriting recognition settings. Since Vista learns from your writing and corrections this represented many, many hours of work.

I just received a spiffy new-ish Lenovo X61 Tablet PC to evaluate, but when I launched the Migration Wizard (technically it's called Windows Easy Transfer or WET) I received a nasty surprise. You're given a prompt to restore from a network drive, USB flash drive or external hard drive. Since I was using a USB flash drive, I naturally chose that.

Then I received an error message that read:

Please insert the first disk to read into the drive you have selected.

Huh?

I tried restarting WET a few times without any luck. I copied the .MIG file to the root of the C:\ drive and tried opening it from there and received a new, yet equally annoying message:

Please select a valid file where your data can be restored from.

A few Google searches reveal that this is a common problem, there is no way to browse the contents of a .MIG file, and WET is a piece of crap that you shouldn't trust with your valuable settings and documents.

Not willing to give up I ran WET one final time and chose External Hard Drive as the source. Success! A few minutes later and all of my settings were restored. Oddly enough after it worked once I was able to open the .MIG file directly and have WET recognize it, or choose USB Flash Drive as the source without any issues.

What worked?

For the most part everything I asked WET to save transferred. My wireless networks did, but oddly enough none of the WEP passwords. Saved network passwords did transfer. WebDAV-synced OneNote notebooks and settings also transferred.