Viewing files in the GAC

It doesn’t happen often, but occasionally I need to copy dlls from the GAC. The problem is that for assemblies prior to .NET 4.0 the contents of the GAC are hidden from explorer by a shell script. I’ve seen a number of solutions to this. Most of them are a bit clunky, but this is the one I like the best.

Open a new command prompt, and enter subst z: c:\windows\assembly

This will map drive z (pick a mor suitable drive letter if you like, of course) to the GAC folder. Doing so bypasses the shell script, allowing you to browse it in explorer just like any other folder.

To remove the drive mapping simply use the command subst z: /d

Addendum

Something to be aware of is that if you call subst from a cmd window with admin privileges, you won’t be able to access the mapped drive from an explorer window. So don’t do that.

Leave a Reply

Your email address will not be published. Required fields are marked *