Register DLL's with right click menu
By nater

'DLLshell.vbs - Add right click context menu
'option to Register or Unregister .dll files.
'© Bill James - billjames.geo@yahoo.com - rev 10 Oct 1999
'
Option Explicit
Dim WshShell,fso,AskDo,DllReg,RegSvr,pct1
Set WshShell = WScript.CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
'
'Confirm change.
AskDo = MsgBox("Do you want to add a right-click context" &_
" menu item to Register and Unregister .dll files?",4)
If AskDo <> 6 Then WScript.Quit
'
'Set path for Regsvr32.exe and make sure it exists.
RegSvr = fso.GetSpecialFolder(1) & "\REGSVR32.EXE"
If not fso.FileExists(RegSvr) Then
MsgBox "Error. Could not locate RegSvr32.exe."
WScript.Quit
End If
'
'variables to reduce line lenghts.
DllReg = "HKCR\dllfile\shell"
'pct1 = Chr(34) & "%1" & Chr(34)
'
'Add the Register context menu item.
WshShell.RegWrite DllReg & "Register","Re&gister DLL"
WshShell.RegWrite DllReg & "Register\command",_
RegSvr & " " & Chr(34) & "%1" & Chr(34)
'
'Add the Unregister context menu item.
WshShell.RegWrite DllReg & "UnRegister","&UnRegister DLL"
WshShell.RegWrite DllReg & "UnRegister\command",_
RegSvr & " /u " & Chr(34) & "%1" & Chr(34)
'
'Cleanup.
Set WshShell = Nothing
Set fso = Nothing

Rating:


0/5 based on 0 votes. The median rating is 0.

Submitted: 11/19/10 (Edited 11/19/10)

Description: This is a cool script that i ran across. It will add an option when you right click on a file to register or un-register it using regsrv32.exe

Tags:

Views: 4315 views. Averaging 1 views per day.
In the most recent 30 day period, there've been 0 views.

Previous Article | Next Article