Hi,

Is the a way to add a .reg file into the registry via a vbs script?

thank

Re: Adding a .reg with vbs by Highlander

Highlander
Sun Jan 28 18:47:52 CST 2007



On Jan 28, 4:34 pm, martinmim <martin...@discussions.microsoft.com>
wrote:
> Hi,
>
> Is the a way to add a .reg file into the registry via a vbs script?
>
> thank

245 results for the three words:
.reg file registry

http://groups.google.com/group/microsoft.public.scripting.vbscript/
search?hl=en&group=microsoft.public.scripting.vbscript&q=.reg+file
+registry&qt_g=Search+this+group

http://www.fuckinggoogleit.com

Have a nice day.


Re: Adding a .reg with vbs by Shenan

Shenan
Sun Jan 28 19:22:00 CST 2007

martinmim wrote:
> Is the a way to add a .reg file into the registry via a vbs script?

I'm sure you could do a Shell 'Run' call - but you could also edit the
registry with vbscript directly...

Maybe some of these can help you?

http://www.microsoft.com/technet/scriptcenter/resources/qanda/nov06/hey1116.mspx
http://www.microsoft.com/technet/scriptcenter/resources/qanda/feb05/hey0224.mspx
http://www.microsoft.com/technet/scriptcenter/resources/qanda/oct04/hey1029.mspx
http://www.microsoft.com/technet/technetmag/issues/2006/08/ScriptingGuy/default.aspx

--
Shenan Stanley
MS-MVP
--
How To Ask Questions The Smart Way
http://www.catb.org/~esr/faqs/smart-questions.html



Re: Adding a .reg with vbs by martinmim

martinmim
Mon Jan 29 13:01:00 CST 2007

thank you I will take a look at it!

"Shenan Stanley" wrote:

> martinmim wrote:
> > Is the a way to add a .reg file into the registry via a vbs script?
>
> I'm sure you could do a Shell 'Run' call - but you could also edit the
> registry with vbscript directly...
>
> Maybe some of these can help you?
>
> http://www.microsoft.com/technet/scriptcenter/resources/qanda/nov06/hey1116.mspx
> http://www.microsoft.com/technet/scriptcenter/resources/qanda/feb05/hey0224.mspx
> http://www.microsoft.com/technet/scriptcenter/resources/qanda/oct04/hey1029.mspx
> http://www.microsoft.com/technet/technetmag/issues/2006/08/ScriptingGuy/default.aspx
>
> --
> Shenan Stanley
> MS-MVP
> --
> How To Ask Questions The Smart Way
> http://www.catb.org/~esr/faqs/smart-questions.html
>
>
>

Re: Adding a .reg with vbs by Richard

Richard
Wed Jan 31 15:45:32 CST 2007

If you have a reg file on the machine, and want to use that instead of
scripting with the RegWrite method of wshShell (or WMI), the code could be
similar to below:

' Specify location of the reg file.
strRegFile = "c:\scripts\MyUpdate.reg"

' Specify the command to merge the reg file into the local registry.
strCmd = "%comspec% /c regsvr32 /s " & strRegFile

' Run the command.
Set objShell = CreateObject("Wscript.Shell")
objShell.Run(strCmd)

--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab web site - http://www.rlmueller.net
--

"martinmim" <martinmim@discussions.microsoft.com> wrote in message
news:6ED4EB4A-63B9-4A28-9723-91741871D89E@microsoft.com...
> thank you I will take a look at it!
>
> "Shenan Stanley" wrote:
>
> > martinmim wrote:
> > > Is the a way to add a .reg file into the registry via a vbs script?
> >
> > I'm sure you could do a Shell 'Run' call - but you could also edit the
> > registry with vbscript directly...
> >
> > Maybe some of these can help you?
> >
> >
http://www.microsoft.com/technet/scriptcenter/resources/qanda/nov06/hey1116.mspx
> >
http://www.microsoft.com/technet/scriptcenter/resources/qanda/feb05/hey0224.mspx
> >
http://www.microsoft.com/technet/scriptcenter/resources/qanda/oct04/hey1029.mspx
> >
http://www.microsoft.com/technet/technetmag/issues/2006/08/ScriptingGuy/default.aspx
> >
> > --
> > Shenan Stanley
> > MS-MVP
> > --
> > How To Ask Questions The Smart Way
> > http://www.catb.org/~esr/faqs/smart-questions.html
> >
> >
> >



Re: Adding a .reg with vbs by Ayush

Ayush
Wed Jan 31 16:33:47 CST 2007

Replied to [Richard Mueller [MVP]]s message :
> If you have a reg file on the machine, and want to use that instead of
> scripting with the RegWrite method of wshShell (or WMI), the code could be
> similar to below:
>
> ' Specify location of the reg file.
> strRegFile = "c:\scripts\MyUpdate.reg"
>
> ' Specify the command to merge the reg file into the local registry.
> strCmd = "%comspec% /c regsvr32 /s " & strRegFile


regsvr32 !! It is regedit and regedit will work directly (Without command prompt) :
strCmd = "regedit /s " & strRegFile

And if the OP wants to use command prompt then :
reg.exe Import "RegFilePath.reg"

--
â?? Ayush
-------------
Search - www.Google.com | Wikipedia - http://en.wikipedia.org
Snip your long urls - http://snipurl.com/
-------------

Re: Adding a .reg with vbs by Richard

Richard
Wed Jan 31 16:39:46 CST 2007


"Ayush" <"ayushmaan.j[aatt]gmail.com"> wrote in message
news:utoBOgYRHHA.4000@TK2MSFTNGP04.phx.gbl...
> Replied to [Richard Mueller [MVP]]s message :
> > If you have a reg file on the machine, and want to use that instead of
> > scripting with the RegWrite method of wshShell (or WMI), the code could
be
> > similar to below:
> >
> > ' Specify location of the reg file.
> > strRegFile = "c:\scripts\MyUpdate.reg"
> >
> > ' Specify the command to merge the reg file into the local registry.
> > strCmd = "%comspec% /c regsvr32 /s " & strRegFile
>
>
> regsvr32 !! It is regedit and regedit will work directly (Without command
prompt) :
> strCmd = "regedit /s " & strRegFile
>
> And if the OP wants to use command prompt then :
> reg.exe Import "RegFilePath.reg"
>
> --
> ? Ayush
> -------------
> Search - www.Google.com | Wikipedia - http://en.wikipedia.org
> Snip your long urls - http://snipurl.com/
> -------------

You're right, the command is regedit.My mistake.

--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab web site - http://www.rlmueller.net
--