June 2008 - Posts

Copying Files from the GAC

We've all installed files in the GAC before, (right?) but how do you copy files FROM the GAC?  I found a lot of little things here and there while Googling it, but nothing about copying a lot of files.  I needed to copy a bunch of files and copying each file, one by one, takes a long time.  I wanted one action to take care of all of it.  The directory c:\windows\assembly doesn't allow you to copy-paste out of it.  In order to pull files out, you have to use the command line.  If you did, you'd notice that the directory structure is a bit different from what windows file explorer would tell you.  After a little tinkering, I came up with this:

To pull out all files in the GAC, run this at this location:

C:\WINDOWS\assembly\GAC_MSIL>xcopy *.* C:\GACDLLs\ /s /r

The exact subdirectory of assembly might change.  Check first.  It might be GAC or GAC_32.  Look for the files you want first, as you might have more than one of the subdirectories I listed above (I had all three).

Very cool.  Saved me a lot of time.

Posted by vbullinger
Filed under: ,