Monday, 23 August 2010

How to get the files from GAC in Windows

This is what I think about since I started working on Windows. I don't know how to see the Windows GAC files and get them for other use. For example, sometimes I deploy the files to GAC location and then want to move the same dll to some other server. But, as usual, the original files missed from the file system. The only location I can get them is GAC. But, don't know how to get the files from GAC. This is a big question and resolved my my colleague Phani recently. I was surprised and felt very happy after the resolution he found and now I am utilizing it very efficiently.
There is a command available in Windows for doing the task. "subst".

The command will create a virtual folder of all GAC files to a separate drive. Below is the syntax:
subst Z: C:\windows\Assembly
When you go to the my computer you will find a new drive under the regular drives. Just go inside and you can see all the GAC files. The folder GAC_MSIL is what your all files reside in. Copy the dll's you needed and paste them in some safe location for backup.

To remove the Z drive from machine, then use below command.
subst Z: /D
All credits goes to Phani and take a look at this post from him for more information. Enjoy some nice tips and rare findings from the blog.

No comments:

Post a Comment