|
-
Dec 4th, 2006, 06:14 AM
#1
Thread Starter
Lively Member
[RESOLVED] regsvr32
I am using shell and regsvr32 for registring DLL files it work perfectly on some PC's but in some PC i have to manually register the DLL to make it work. i am using "/s" as argument with regsvr32 for no popup messagebox but when i remove "/s" argument it work on ervery PC wihtout any problem.. is there anything i have to know about regsvr32 and "/s" argument? why not my DLL's are registring on some PC when i use "/s"?.. is there any better option for registring DLL files?
-
Dec 4th, 2006, 07:28 AM
#2
Re: regsvr32
If you are registering dll's do you have the correct location for these dll's. Not all drives are C:\ and not all Windows\System folders are the same. You can find the Win\Sys folder through an API call and you can find the drive letter from Left(Win\Sys folder, 2).
Can you post an example of your Shell line?
Keith
I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
-
Dec 4th, 2006, 07:52 AM
#3
Re: regsvr32
This should work:
VB Code:
Option Explicit
Private Declare Function GetSystemDirectory Lib "kernel32" Alias _
"GetSystemDirectoryA" (ByVal lpBuffer As _
String, ByVal nSize As Long) As Long
Private Sub Form_Load()
Dim sSave As String, Ret As Long
sSave = Space(255)
Ret = GetSystemDirectory(sSave, 255)
sSave = Left$(sSave, Ret)
If Right(sSave, 1) <> "\" Then sSave = sSave & "\"
Shell sSave & "regsvr32 /s [B]YOURFILETOREGISTER.DLL[/B]"
End Sub
-
Dec 4th, 2006, 03:55 PM
#4
Re: regsvr32
That isn't what I had in mind gavio. That will find the Win\Sys folder for regsvr32. You don't need that, Windows and System are in the Windows path.
I was think if he wants to register this dll he might want to register it in the Win\Sys folder or in his App.Path.
Keith
I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
-
Dec 5th, 2006, 12:57 AM
#5
Thread Starter
Lively Member
Re: regsvr32
thx for rpl
i am using the same way that gavio using..... and my DLL are in my app folder not in sys or win folder
gavio
why are you using this line?
"sSave = Space(255)"
is that matter if i use argument as "/s" or "-s"
-
Dec 5th, 2006, 01:36 AM
#6
Thread Starter
Lively Member
Re: regsvr32
thx for rpl
problem solved
i am not using space after "/s" ... .... sorry .....
-
Dec 5th, 2006, 05:30 PM
#7
Re: regsvr32
 Originally Posted by xor83
thx for rpl
i am using the same way that gavio using..... and my DLL are in my app folder not in sys or win folder
gavio
why are you using this line?
"sSave = Space(255)"
is that matter if i use argument as "/s" or "-s"
Thats how you retrieve the System folder it could be a maximum of 255 characters. If your dll's are in the App.Path you can use that variable.
VB Code:
Shell "regsvr32 /s " & App.Path & "\YOURFILETOREGISTER.DLL"
Normally switches are /s for regsvr32. If its your own app that needs switches they can be anything you specify in Command$. @s $s *s
Last edited by Keithuk; Dec 5th, 2006 at 05:34 PM.
Keith
I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|