As we continue our journey through shims provided by the Windows Shim Infrastructure, we have reached a point where I can no longer avoid a discussion of the shims contained in acredir.dll: RedirectFiles and RedirectRegistry.

Last time around, I pointed out how to redirect the registry using VirtualRegistry, which requires a command line argument which (for a very long time) was not publicly documented. Instead, a lot of people have been using RedirectRegistry, for two important and logical reasons. First, the name just sounds so tempting, since that's exactly what you likely want to do. Second, the act.chm actually does document these shims. So, I understand why people would rationally flock to these shims.

However, one of the internal questions that I address quite a bit: why can't I get xxx application to work with the RedirectFiles shim? Am I putting in the command line wrong? (and the command line follows)

So, I'll just say this. You shouldn't use these shims, because they're not designed to do what you think they're designed to do. Specifically, they target Internet Explorer.

Try it. From Compatibility Administrator, press the Query button on the toolbar. The second tab, fix properties, allows you to find programs fixed using a shim. Put one of these two shims in there, and then press the Find Now button. IE7 is the only thing that comes up. Now, try either VirtualRegistry or CorrectFilePaths. Lots and lots of things come up.

You see, IE7 leverages the Windows Shim Infrastructure to resolve an important compatibility issue: attempts by ActiveX controls to write to areas that Mandatory Integrity Control prevents them from writing to in LORIE, implementing an Internet Registry and Internet File System - a separate Virtual Store than that used by the operating system - and these two shims help make that happen.

So, these two shims are specifically designed and optimized around this one scenario, and were even separated off into their own DLL to help keep them separate. The problem is that we include the acredir.dll shims in Compatibility Administrator without this caveat. They have tempting names. We give them good documentation. So it's no surprise that people use them.

Instead of RedirectRegistry, I recommend using VirtualRegistry, which can redirect (among other things). Instead of RedirectFiles, I recommend using CorrectFilePaths (which I haven't talked about here yet, but I'm getting there).