Registering and Unregistering a Type Library File With VBScript

After working on a project where we had to register and unregister a type library, my team quickly found out that hacking through the registry isn't a lot of fun. Recently, I was reading Bruce McKinney's good-bye to Visual Basic on DevX's site (i.e. he gave them the middle finger) and I noticed a code snippet on how you could use the TypeLib Information component (TLBINF32.DLL) to register and unregister type libraries. After messing around with WSH for a while, I came up with the following VBScript file, which you can get by clicking here. Basically, the script file takes two command line arguments. The first one is the location of the TLB file, and the second is a switch for registering (-r) or unregistering (-u) the file. Have fun!

Blog History