Click here to Skip to main content
11,922,789 members (53,761 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


6 bookmarked

Registering DLL's in Remote Host.

, 29 Jul 2002
Rate this:
Please Sign up or sign in to vote.
Registering DLL's in Remote Host.

Registering DLL's in Remote Host.

Registering DLL's have 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 adminstrator 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 WSH 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 to DLL to be registered/un registerd<BR>"
                                Response.write "<INPUT TYPE=CHECKBOX NAME=ACTIONTYPE CHECKED>Check to Register; Uncheck to Unregister<BR>"
                                Response.write "<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=SUBMIT></CENTER>"
                                Response.write "</FORM>"

                                 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.



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
No Biography provided

You may also be interested in...

Comments and Discussions

-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.151125.1 | Last Updated 30 Jul 2002
Article Copyright 2002 by Gopi Subramanian
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid