Hi all,

any know script for write in registry windows?

Re: write registry by Torgeir

Torgeir
Mon Jan 24 13:29:10 CST 2005

Keppler wrote:

> Hi all,
>
> any know script for write in registry windows?
Hi

WSH's RegWrite method:

'--------------------8<----------------------
Set oShell = CreateObject("WScript.Shell")
oShell.RegWrite "HKCR\PerlScript\Shell\Open\Command\", _
"perl.exe ""%1""", "REG_SZ"
'--------------------8<----------------------

and:

Script Repository: Registry
http://www.microsoft.com/technet/scriptcenter/scripts/os/registry/default.mspx


WSH 5.6 documentation (local help file) can be downloaded from here
if you haven't got it already:
http://msdn.microsoft.com/downloads/list/webdev.asp



--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx

Re: write registry by McKirahan

McKirahan
Mon Jan 24 13:32:42 CST 2005

"Keppler" <kill@flls.com> wrote in message
news:u5RVhckAFHA.3616@TK2MSFTNGP11.phx.gbl...
> Hi all,
>
> any know script for write in registry windows?

Here's the example that gets installed in \Windows\Samples\Wsh\

' Windows Script Host Sample Script
'
' ------------------------------------------------------------------------
' Copyright (C) 1996-1997 Microsoft Corporation
'
' You have a royalty-free right to use, modify, reproduce and distribute
' the Sample Application Files (and/or any modified version) in any way
' you find useful, provided that you agree that Microsoft has no warranty,
' obligations or liability for any Sample Application Files.
' ------------------------------------------------------------------------
'
' This sample demonstrates how to write/delete entries in the registry.


L_Welcome_MsgBox_Message_Text = "This script demonstrates how to create
and delete registry keys."
L_Welcome_MsgBox_Title_Text = "Windows Scripting Host Sample"
Call Welcome()


'
****************************************************************************
****
' *
' * Registry related methods.
' *

Dim WSHShell
Set WSHShell = WScript.CreateObject("WScript.Shell")

WSHShell.Popup "Create key HKCU\MyRegKey with value 'Top level key'"
WSHShell.RegWrite "HKCU\MyRegKey\", "Top level key"

WSHShell.Popup "Create key HKCU\MyRegKey\Entry with value 'Second level
key'"
WSHShell.RegWrite "HKCU\MyRegKey\Entry\", "Second level key"

WSHShell.Popup "Set value HKCU\MyRegKey\Value to REG_SZ 1"
WSHShell.RegWrite "HKCU\MyRegKey\Value", 1

WSHShell.Popup "Set value HKCU\MyRegKey\Entry to REG_DWORD 2"
WSHShell.RegWrite "HKCU\MyRegKey\Entry", 2, "REG_DWORD"

WSHShell.Popup "Set value HKCU\MyRegKey\Entry\Value1 to REG_BINARY 3"
WSHShell.RegWrite "HKCU\MyRegKey\Entry\Value1", 3, "REG_BINARY"

WSHShell.Popup "Delete value HKCU\MyRegKey\Entry\Value1"
WSHShell.RegDelete "HKCU\MyRegKey\Entry\Value1"

WSHShell.Popup "Delete key HKCU\MyRegKey\Entry"
WSHShell.RegDelete "HKCU\MyRegKey\Entry\"

WSHShell.Popup "Delete key HKCU\MyRegKey"
WSHShell.RegDelete "HKCU\MyRegKey\"

'
****************************************************************************
****
' *
' * Welcome
' *
Sub Welcome()
Dim intDoIt

intDoIt = MsgBox(L_Welcome_MsgBox_Message_Text, _
vbOKCancel + vbInformation, _
L_Welcome_MsgBox_Title_Text )
If intDoIt = vbCancel Then
WScript.Quit
End If
End Sub



Re: write registry by Keppler

Keppler
Tue Jan 25 05:24:17 CST 2005

thank's

"McKirahan" <News@McKirahan.com> escreveu na mensagem
news:X7udnfjqjfXH0GjcRVn-iA@comcast.com...
> "Keppler" <kill@flls.com> wrote in message
> news:u5RVhckAFHA.3616@TK2MSFTNGP11.phx.gbl...
> > Hi all,
> >
> > any know script for write in registry windows?
>
> Here's the example that gets installed in \Windows\Samples\Wsh\
>
> ' Windows Script Host Sample Script
> '
> ' ------------------------------------------------------------------------
> ' Copyright (C) 1996-1997 Microsoft Corporation
> '
> ' You have a royalty-free right to use, modify, reproduce and distribute
> ' the Sample Application Files (and/or any modified version) in any way
> ' you find useful, provided that you agree that Microsoft has no warranty,
> ' obligations or liability for any Sample Application Files.
> ' ------------------------------------------------------------------------
> '
> ' This sample demonstrates how to write/delete entries in the registry.
>
>
> L_Welcome_MsgBox_Message_Text = "This script demonstrates how to create
> and delete registry keys."
> L_Welcome_MsgBox_Title_Text = "Windows Scripting Host Sample"
> Call Welcome()
>
>
> '
>
****************************************************************************
> ****
> ' *
> ' * Registry related methods.
> ' *
>
> Dim WSHShell
> Set WSHShell = WScript.CreateObject("WScript.Shell")
>
> WSHShell.Popup "Create key HKCU\MyRegKey with value 'Top level key'"
> WSHShell.RegWrite "HKCU\MyRegKey\", "Top level key"
>
> WSHShell.Popup "Create key HKCU\MyRegKey\Entry with value 'Second level
> key'"
> WSHShell.RegWrite "HKCU\MyRegKey\Entry\", "Second level key"
>
> WSHShell.Popup "Set value HKCU\MyRegKey\Value to REG_SZ 1"
> WSHShell.RegWrite "HKCU\MyRegKey\Value", 1
>
> WSHShell.Popup "Set value HKCU\MyRegKey\Entry to REG_DWORD 2"
> WSHShell.RegWrite "HKCU\MyRegKey\Entry", 2, "REG_DWORD"
>
> WSHShell.Popup "Set value HKCU\MyRegKey\Entry\Value1 to REG_BINARY 3"
> WSHShell.RegWrite "HKCU\MyRegKey\Entry\Value1", 3, "REG_BINARY"
>
> WSHShell.Popup "Delete value HKCU\MyRegKey\Entry\Value1"
> WSHShell.RegDelete "HKCU\MyRegKey\Entry\Value1"
>
> WSHShell.Popup "Delete key HKCU\MyRegKey\Entry"
> WSHShell.RegDelete "HKCU\MyRegKey\Entry\"
>
> WSHShell.Popup "Delete key HKCU\MyRegKey"
> WSHShell.RegDelete "HKCU\MyRegKey\"
>
> '
>
****************************************************************************
> ****
> ' *
> ' * Welcome
> ' *
> Sub Welcome()
> Dim intDoIt
>
> intDoIt = MsgBox(L_Welcome_MsgBox_Message_Text, _
> vbOKCancel + vbInformation, _
> L_Welcome_MsgBox_Title_Text )
> If intDoIt = vbCancel Then
> WScript.Quit
> End If
> End Sub
>
>



Re: write registry by Keppler

Keppler
Tue Jan 25 05:24:36 CST 2005

thank's

"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> escreveu na mensagem
news:#LKElskAFHA.2060@TK2MSFTNGP15.phx.gbl...
> Keppler wrote:
>
> > Hi all,
> >
> > any know script for write in registry windows?
> Hi
>
> WSH's RegWrite method:
>
> '--------------------8<----------------------
> Set oShell = CreateObject("WScript.Shell")
> oShell.RegWrite "HKCR\PerlScript\Shell\Open\Command\", _
> "perl.exe ""%1""", "REG_SZ"
> '--------------------8<----------------------
>
> and:
>
> Script Repository: Registry
>
http://www.microsoft.com/technet/scriptcenter/scripts/os/registry/default.mspx
>
>
> WSH 5.6 documentation (local help file) can be downloaded from here
> if you haven't got it already:
> http://msdn.microsoft.com/downloads/list/webdev.asp
>
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> http://www.microsoft.com/technet/scriptcenter/default.mspx