Results 1 to 7 of 7

Thread: [RESOLVED] regsvr32

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2005
    Posts
    120

    Resolved [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?

  2. #2
    PowerPoster Keithuk's Avatar
    Join Date
    Jan 2004
    Location
    Staffordshire, England
    Posts
    2,236

    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.

  3. #3
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: regsvr32

    This should work:
    VB Code:
    1. Option Explicit
    2.  
    3. Private Declare Function GetSystemDirectory Lib "kernel32" Alias _
    4.                          "GetSystemDirectoryA" (ByVal lpBuffer As _
    5.                          String, ByVal nSize As Long) As Long
    6. Private Sub Form_Load()
    7.     Dim sSave As String, Ret As Long
    8.         sSave = Space(255)
    9.         Ret = GetSystemDirectory(sSave, 255)
    10.         sSave = Left$(sSave, Ret)
    11.             If Right(sSave, 1) <> "\" Then sSave = sSave & "\"
    12.                 Shell sSave & "regsvr32 /s [B]YOURFILETOREGISTER.DLL[/B]"
    13. End Sub

  4. #4
    PowerPoster Keithuk's Avatar
    Join Date
    Jan 2004
    Location
    Staffordshire, England
    Posts
    2,236

    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.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jun 2005
    Posts
    120

    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"

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Jun 2005
    Posts
    120

    Re: regsvr32

    thx for rpl
    problem solved
    i am not using space after "/s" ... .... sorry .....

  7. #7
    PowerPoster Keithuk's Avatar
    Join Date
    Jan 2004
    Location
    Staffordshire, England
    Posts
    2,236

    Re: regsvr32

    Quote 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:
    1. 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
  •  



Click Here to Expand Forum to Full Width