Results 1 to 5 of 5

Thread: [RESOLVED] restrictions

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2006
    Location
    Greater Manchester, UK
    Posts
    476

    Resolved [RESOLVED] restrictions

    i am trying to make a program that sets restrictions on user accounts, i have checkboxes that the admin checks to set restrictions on the user accounts, but i need the code to add a .reg file to the registry.

    can anybody help me plz

    chris1990

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: restrictions

    shell regsrvr32, there is a parameter that will stop the messageboxes, maybe /s
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3
    Giants World Champs!!!! Mark Gambo's Avatar
    Join Date
    Sep 2003
    Location
    Colorado
    Posts
    2,965

    Re: restrictions

    Quote Originally Posted by chris1990
    i am trying to make a program that sets restrictions on user accounts, i have checkboxes that the admin checks to set restrictions on the user accounts, but i need the code to add a .reg file to the registry.

    can anybody help me plz

    chris1990

    Make sure that you encript the data somehow. I personally would use a database but I don't know what type of application you have designed. Tell us more about your app.
    Regards,

    Mark

    Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."


  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2006
    Location
    Greater Manchester, UK
    Posts
    476

    Question Re: restrictions

    I am trying to make a program like the one in the hyperlink

    i think it uses the reg

    http://www.softheap.com/secagentscreenshots.html

  5. #5
    Fanatic Member schoolbusdriver's Avatar
    Join Date
    Jan 2006
    Location
    O'er yonder
    Posts
    1,020

    Re: restrictions

    Quote Originally Posted by chris1990
    but i need the code to add a .reg file to the registry
    For merging .reg files, use regedit.exe
    Code:
    'From the command line.
    ' /s means silent mode merging.
    
    regedit /s C:\Temp\MySettings.reg
    If you want to do it in VB use ShellExecute:-
    VB Code:
    1. Option Explicit
    2.  
    3. 'Form level code.
    4. Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
    5.    (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
    6.    ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
    7.  
    8. Const SW_HIDE = 0
    9.  
    10. Private Sub Form_Click()
    11.    Dim retval As Long
    12.  
    13. 'Merge it without confirmation messages.
    14.    retval = ShellExecute(Me.hwnd, "open", "regedit.exe", "/s C:\Temp\MySettings.reg", vbNullString, SW_HIDE)
    15. End Sub

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