|
-
Oct 8th, 2006, 04:35 AM
#1
Thread Starter
Hyperactive Member
[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
-
Oct 8th, 2006, 04:53 AM
#2
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
-
Oct 8th, 2006, 05:40 AM
#3
Re: restrictions
 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."
-
Oct 9th, 2006, 03:11 PM
#4
Thread Starter
Hyperactive Member
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
-
Oct 9th, 2006, 04:28 PM
#5
Re: restrictions
 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:
Option Explicit
'Form level code.
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Const SW_HIDE = 0
Private Sub Form_Click()
Dim retval As Long
'Merge it without confirmation messages.
retval = ShellExecute(Me.hwnd, "open", "regedit.exe", "/s C:\Temp\MySettings.reg", vbNullString, SW_HIDE)
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|