Скрипт чтения ключей из реестра

Option Explicit
On Error Resume Next
Dim objShell
Dim regActiveComputerName, regComputerName, regHostname, regAutoReboot, regMinidumpDir
Dim regLogEvent, regDumpFile
Dim ActiveComputerName, ComputerName, HostName, AutoReboot, MinidumpDir, LogEvent, DumpFile

regActiveComputerName = "HKLM\SYSTEM\CurrentControlSet\Control\"&_
"ComputeName\ActiveComputerName\ComputerName"
regComputerName = "HKLM\SYSTEM\CurrentControlSet\Control\" &_
"ComputerName\ComputerName\ComputerName"
regHostname = "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parametrs\Hostname"
regAutoReboot "HKLM\SYSTEM\CurrentControlSet\Control\"&_
"CrashControl\AutoReboot"
regMinidumpDir = "HKLM\SYSTEM\CurrentControlSet\Control\"&_
"CrashControl\MinidumpDir"
regLogEvent = "HKLM\SYSTEM\CurrentControlSet\Control\"&_
"CrashControl\LogEvent"
regDumpFile ="HKLM\SYSTEM\CurrentControlSet\Control\"&_
"CrashControl\DumpFile"

Set objShell = CreateObject("WScript.Shell")
ActiveComputerName=objShell.RegRead(regActiveComputerName)
ComputerName=objShell.RegRead(regComputerName)
HostName = objShell.RegRead(regHostname)
AutoReboot = objShell.RegRead(regAutoReboot)
MinidumpDir = objShell.RegRead(regMinidumpDir)
LogEvent = objShell.RegRead(regLogEvent)
DumpFile = objShell.RegRead(regDumpFile)

WScript.Echo ActiveComputerName & "is active computer name"
WScript.Echo ComputerName & "is computer name"
WScript.Echo HostName & "is host name"
WScript.Echo AutoReboot & " autoreboot"
WScript.Echo MinidumpDir & " MinidumpDir"
WScript.Echo LogEvent & " LogEvent"
WScript.Echo DumpFile & " DumpFile"

Также интересно:

Интересное на сайте: 
0
Голосов пока нет

Оставить комментарий