ne mora da bude ocx unutar system32 foldera, tj ukoliko je custom dll/ocx onda je pozeljnije drzati ga uz aplikaciju a ne trpati sve u sistemski folder (mada je u ovom slucaju bolja solucija kopirati u system32)
da ne bi pokretali command promt (posto ima onih programera koji iz ne znam kojih razloga ne vole da koriste konzolu) mozete napraviti ovakav .vbs fajl:
Code:
Dim FSO
Dim RegShell
Dim regsvr
Dim answer1
Dim answer2
answer1 = MsgBox("This script will add Register and Unregister" & vbCrLf & _
"options to right-click menu on *.dll and *.ocx files" & vbCrLf & _
"allowing you to just double-click *.dll or *.ocx file" & vbCrLf & _
"to register it!" & vbCrLf & vbCrLf & _
"Click 'Yes' to continue." & vbCrLf & _
"If you want to remove this feature click 'No'." & vbCrLf & _
"Click 'Cancel' to leave settings unchanged.", _
vbYesNoCancel + vbQuestion, "DLL & OCX reg-unreg")
answer2 = MsgBox("Do you want to display *.dll and *.ocx files as icons in explorer?", _
vbYesNoCancel + vbQuestion, "DefaultIcons")
Set FSO = WScript.CreateObject("Scripting.FileSystemObject")
Set RegShell = WScript.CreateObject("WScript.Shell")
regsvr = Replace(FSO.getSpecialFolder(1) & "\RegSvr32.exe", "\\", "\")
If answer1 = vbYes Then
If FSO.FileExists(regsvr) = False Then
Call MsgBox("RegSvr32.exe file not found!" & vbCrLF & _
"Cannot continue setup.", vbOKOnly + vbCritical, "Error")
Else
Dim cmdReg
Dim cmdUnreg
cmdReg = Chr(34) & regsvr & Chr(34) & " " & Chr(34) & "%1" & Chr(34)
cmdUnreg = Chr(34) & regsvr & Chr(34) & " /u " & Chr(34) & "%1" & Chr(34)
Call RegShell.RegWrite("HKCR\dllfile\shell\open\", "Register")
Call RegShell.RegWrite("HKCR\dllfile\shell\open\command\", cmdReg)
Call RegShell.RegWrite("HKCR\dllfile\shell\unreg\", "Unregister")
Call RegShell.RegWrite("HKCR\dllfile\shell\unreg\command\", cmdUnreg)
Call RegShell.RegWrite("HKCR\ocxfile\shell\open\", "Register")
Call RegShell.RegWrite("HKCR\ocxfile\shell\open\command\", cmdReg)
Call RegShell.RegWrite("HKCR\ocxfile\shell\unreg\", "Unregister")
Call RegShell.RegWrite("HKCR\ocxfile\shell\unreg\command\", cmdUnreg)
End If
Else
If answer1 = vbNo Then
Call RegShell.RegDelete("HKCR\dllfile\shell\open\")
Call RegShell.RegDelete("HKCR\dllfile\shell\unreg\")
Call RegShell.RegDelete("HKCR\ocxfile\shell\open\")
Call RegShell.RegDelete("HKCR\ocxfile\shell\unreg\")
End If
End If
If answer2 = vbYes Then
Call RegShell.RegWrite("HKCR\dllfile\DefaultIcon\", "%1")
Call RegShell.RegWrite("HKCR\ocxfile\DefaultIcon\", "%1")
Else
If answer2 = vbNo Then
Call RegShell.RegWrite("HKCR\dllfile\DefaultIcon\", "")
Call RegShell.RegWrite("HKCR\ocxfile\DefaultIcon\", "")
End If
End If
i pokrenuti ga (dupli-klik).. ovo sam davno napisao bas zbog jednog takvog programera koji ne voli rad u konzoli...