Компьютерный форум OSzone.net  

Компьютерный форум OSzone.net (http://forum.oszone.net/index.php)
-   Скриптовые языки администрирования Windows (http://forum.oszone.net/forumdisplay.php?f=102)
-   -   [решено] Как добавить данные к существующей ветке реестра (http://forum.oszone.net/showthread.php?t=274904)

Valek271183 29-12-2013 19:53 2280365

Как добавить данные к существующей ветке реестра
 
Есть ветка HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation в ней "Manufacturer"="MSI" как можно дописать с помощью .BAT или .reg к слову "MSI" ещё что-нибудь?

Iska 29-12-2013 20:14 2280371

Valek271183, перепишите.

Или на WSH:
читать дальше »
Код:

Option Explicit

Const HKEY_LOCAL_MACHINE = &H80000002

Dim strValue


With WScript.CreateObject("WbemScripting.SWbemLocator").ConnectServer(".", "root\default")
        With .Get("StdRegProv")
                If .GetStringValue(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation", "Manufacturer", strValue) = 0 Then
                        strValue = strValue & " bla-bla-bla"
                       
                        If Not .SetStringValue(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation", "Manufacturer", strValue) = 0 Then
                                WScript.Echo "Can't write registry parameter"
                        End If
                Else
                        WScript.Echo "Can't read registry parameter"
                End If
        End With
End With

WScript.Quit 0



Время: 01:09.

Время: 01:09.
© OSzone.net 2001-