Click here to Skip to main content
Licence 
First Posted 30 Jul 2002
Views 64,767
Bookmarked 29 times

Registering DLL's in a Remote Host

By | 30 Jul 2002 | Article
Registering DLL's has always been a nightmare to all the programmers who have to work with remote WebServers.

Introduction

Registering DLL's has always been a nightmare to all the programmers who have to work with remote WebServers.  Its even horrible with servers having customized security settings. Every time the the Server administrator have to be pinged to register / unregister DLLs.

An easy work around to this problem is to use ASP pages to register / unregister the DLLs. The key to this operation is to use the RUN method of the Windows Scripting Host WshShell class.

Following is a simple asp page using run method to register Dlls.

<%
Dim strPageName
strPageName = "Reg.asp"
If Request.Form("SUBMIT") = "" Then
    Response.write "<CENTER><FORM ACTION=""" & strPageName & """ METHOD=POST>"
    Response.write "<INPUT TYPE=TEXT NAME=FILEPATH SIZE=120>Full Path/Filename "
    Response.write "to DLL to be registered/un registerd<BR>"
    Response.write "<INPUT TYPE=CHECKBOX NAME=ACTIONTYPE CHECKED>Check to "
    Response.write "Register; Uncheck to Unregister<BR>"
    Response.write "<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=SUBMIT></CENTER>"
    Response.write "</FORM>"
Else
    Set objFileSystem = Server.CreateObject("Scripting.FileSystemObject")
    strPath = objFileSystem.GetSpecialFolder(1) & "\REGSVR32.EXE /s "
    Set objWshShell = CreateObject("WScript.Shell")
    strRun = "CMD /C " & strPath & " /u "
    If Request.Form("ACTIONTYPE")="on" Then strRun = "CMD /C " & strPath
    strReturn = objWshShell.Run(strRun & Request.Form("FILEPATH"), 1, True)  
    Set objFileSystem = Nothing
    Set objWshShell = Nothing
End If
%>

Copy the entire script above including the <% %> script delimiters, and paste it into Notepad and save it as "Reg.asp" on your server Now the only thing you have to know is the drive letter, path and name of the DLL.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Gopi Subramanian

Web Developer

India India

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralDoesnt work Pinmembersarinb1:01 12 Sep '06  
GeneralASP Pinmembersuman_sunil4:24 5 Feb '04  
GeneralGreat Script PinsussAnonymous12:05 29 Aug '02  
GeneralAnother security bug!!! PinmemberDaniel Turini5:27 31 Jul '02  
GeneralBig, big security leak! PinmemberDaniel Lohmann1:25 31 Jul '02  
GeneralSecurity BUG!!!!!!! PinmemberDaniel Turini23:04 30 Jul '02  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web01 | 2.5.120517.1 | Last Updated 31 Jul 2002
Article Copyright 2002 by Gopi Subramanian
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid