Здравствуйте, Other Sam, Вы писали:
OS>Вот пример на vbs
OS>OS>Option Explicit
OS>Dim wsh
OS>Dim homepath
OS>Set wsh = CreateObject("WScript.Shell")
OS>homepath = wsh.RegRead("HKEY_CURRENT_USER\Volatile Environment\HOMEPATH")
OS>WScript.Echo homepath
OS>
А как быть(используя только скрипт) если надо записать "большой" REG_BINARY ?
Типа такого?
"Boot Bus Extender"=hex:07,00,00,00,07,00,00,00,01,00,00,00,02,00,00,00,04,00,00,00,05,00,00,00,06,00,00,00,00,3e,00,3e
Сможешь с помощью WScript.Shell?
У меня не получилось, вот с помощью WMI:
'
'The following information applies to all version of SoftICE running on windows 2000 SP4.
'If you are experiencing a garbled screen when softice is configured for boot mode, the following workaround will be required.
'3. Using Regedit go to HKLM\System\CurrentControlSet\Services\Siwvid and change its Group to be "Boot Bus Extender" without the quotes.
'4. Make note of its tag value, it should be 0x10.
'5. Go to the following registry key, HKLM\System\CurrentControlSet\Control\GroupOrderList.
'6. Double click on boot bus extender. Increase the first byte by one. After entering in the +1 value you will most likely need to hit the delete key depending ' on which registry editor you are using.
'7. Add the value for the SiwVid tag (hex value of ten) as the first entry directly after the count byte. You would enter this as (assuming byte display is
' showing) 00 00 00 10. For example if your entry used to look like "02 00 00 00 40 00 00 00 20", it will now look like "03 00 00 00 10 00 00 00 40 00 00 00 20"
'8. Make sure /noguiboot is in your boot.ini file for the os that is being debugged
'9. Reboot.
'
'
'
Const HKEY_CLASSES_ROOT = &H80000000
Const HKEY_CURRENT_USER = &H80000001
Const HKEY_LOCAL_MACHINE = &H80000002
Const HKEY_USERS = &H80000003
Const HKEY_CURRENT_CONFIG = &H80000005
Const HKEY_DYN_DATA = &H80000006
Const cstrSiwvidGroupVal ="Boot Bus Extender"
Dim WshShell
Dim wscVersion
Dim objWMI,objReg
Dim strComputer
Dim strRegKeySiwvid,strRegKeyGOL,valKey
Dim uBinary(),uNewBinary()
'uBinary =
strComputer = "."
strRegKeySiwvid = "System\CurrentControlSet\Services\Siwvid"
strRegKeyGOL = "System\CurrentControlSet\Control\GroupOrderList"
Set WshShell = WScript.CreateObject("WScript.Shell")
wscVersion = cdbl(Replace(WScript.version,".",","))
'wscVersion = cdbl(WScript.version)
'msgbox wscVersion
if wscVersion < 5.6 then
msgbox "WScript version not valid! Required 5.6 or higher!",vbOKOnly
WScript.Quit -1
end if
Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
objReg.GetStringValue HKEY_LOCAL_MACHINE,strRegKeySiwvid,"Group",valKey
If valKey<>cstrSiwvidGroupVal Then
objReg.SetStringValue HKEY_LOCAL_MACHINE,strRegKeySiwvid,"Group",cstrSiwvidGroupVal
end If
objReg.GetDWORDValue HKEY_LOCAL_MACHINE,strRegKeySiwvid,"Tag",valKey
'WScript.echo valKey
objReg.GetBinaryValue HKEY_LOCAL_MACHINE,strRegKeyGOL,"Boot Bus Extender",uBinary
'i = 0
ReDim uNewBinary(UBound(uBinary)+4)
For j = LBound(uBinary) To UBound(uBinary)
If j = Lbound(uBinary) Then
uNewBinary(j) = uBinary(j)+1
'i=i+1
ElseIf j = LBound(uBinary)+1 Then
uNewBinary(j) = 0
uNewBinary(j+1) = 0
uNewBinary(j+2) = 0
uNewBinary(j+3) = 16
uNewBinary(j+4) = uBinary(j)
Else
uNewBinary(j+4) = uBinary(j)
End If
Next
'--------------
For j = LBound(uBinary) To UBound(uBinary)
sMsg = sMsg & uBinary(j) & " "
If j = UBound(uBinary) Then
sMsg = sMsg & vbCrLf
End If
Next
For j = LBound(uNewBinary) To UBound(uNewBinary)
sMsg = sMsg & uNewBinary(j) & " "
If j = UBound(uNewBinary) Then
sMsg = sMsg & vbCrLf
End If
Next
WScript.echo sMsg
'--------------
objReg.SetBinaryValue HKEY_LOCAL_MACHINE,strRegKeyGOL,"Boot Bus Extender",uNewBinary
RSDN@Home 1.1.4 beta 4 340 ....................... Billy Idol — Don't need a gun (single edit)