Is there a way for a program to merge a .reg file (Regedit 4) without asking the user for confirmation?
Thanks
Printable View
Is there a way for a program to merge a .reg file (Regedit 4) without asking the user for confirmation?
Thanks
Open it using your VB prog, then transfer it into the registry?
VB Code:
Shell "regedit.exe somefile.reg /s". vbNormalFocus
Well done dilbert, woops i mean ariel...
Thanks
That works but it still asks for confirmation.
why not try my method?
Weird, try this then:Quote:
Originally posted by jdc6029
That works but it still asks for confirmation.
PassProg does this, just a sec while I check the code...VB Code:
Shell "regedit.exe /s somefile.reg". vbNormalFocus
Here's the code that does what I need with a .reg file...
VB Code:
Sub HideExtraButtonsOnFirstRun() Dim WindowsCommand As String, SystemCommand As String WindowsCommand = GetOSDirectory(WindowsDirectory) & "\regedit.exe" SystemCommand = GetOSDirectory(SystemDirectory) & "\regedit.exe" If Dir(WindowsCommand) <> "" Then AppStr WindowsCommand, " /s " & Chr(34) & App.Path & "\Default Toolbar Setup.reg" & Chr(34) Shell WindowsCommand, vbMinimizedNoFocus Exit Sub Else If Dir(SystemCommand) <> "" Then AppStr WindowsCommand, " /s " & Chr(34) & App.Path & "\Default Toolbar Setup.reg" & Chr(34) Shell SystemCommand, vbMinimizedNoFocus Exit Sub Else MsgBox "Unable to apply toolbar registry patch: to remove extra buttons from the toolbar, " _ & "right-click the toolbar and select Customize.", vbExclamation, "Error" End If End If End Sub
After reading that code it looks like Shell "regedit.exe /s somefile.reg". vbNormalFocus will work. :)
Shell "regedit.exe /s somefile.reg", vbNormalFocus
does work great. Now I just have to make it work with my ShellExecute function so it will work on Win2k also since the Shell command won't work with it, Thanks.
The 'HideExtraButtonsOnFirstRun' is a good sub, thanks also.
To da_silvy
The reason I don't want to use a merge reg function is because my .reg file has over 100 entries and this will save me a lot of coding.
It wouldn't really be that much coding, but ariel's way is better ;)