Vishal Monpara's Blog
Knowledge.ToString()

Blog  | Poem  | Article

Check the existence of COM object registered using regsvr32


I had a chance to work on project which was using a COM object. This object was registered using regsvr32. During application migration to another server, I wanted to check the if this object exists on new server or not. I don't wanted to write VB application to just check that object so suddenly a thought came in my mind. If I write down a vbs script file, with few lines of code, I can check out quickly. Here are the instructions to do it.

For this, you need to create a file checkobject.vbs on your computer and copy/paste the following code in it.

On Error Resume Next
Dim objVariable
Set objVariable = WScript.CreateObject ("Wscript.Network1" )
If Err.Number <> 0 Then
Msgbox "Object is not found", vbCritical
Err.Clear
Else
Msgbox "Object found"
End If
Set objVariable = nothing
Now if you double click on that file, VB Script will be executed and appropriate message will be shown.

Posted On: 05/02/2008 04:03


Feedback

No comments posted yet
Post your comments
Name
Url
Comment

Submit


 

Rate Entry0
( 0 Votes)

 
1 2 3 4 5
Vote
1-Poor 5-Excellent