Wednesday, June 01, 2011

Fixing 'a dynamic link library (DLL) initialization routine failed' error

I encountered an error with using regsvr32.exe that says 'a dynamic link library (DLL) initialization routine failed'. As if trying to re-register a system .dll that had its registration corrupted wasn't bad enough.

Thankfully, the web provided a simple solution.

By using a nice tool called Dependency Walker, I immediately identified that it was a missing msjava.dll file that caused the error. Running sfc /scannow fixed that, although it may be faster to manually extract the file from the Windows XP setup CD.

Once msjava.dll was restored, regsvr32.exe worked fine again.