前几天,5月2号吧,应朋友要求,帮忙写一个脚本,根据系统情况,不同版本系统执行不同的注册表脚本,以下是脚本内容:
On Error Resume Next
strComputer = "."Set oShell = CreateObject("Wscript.Shell")
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")Set colItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystem",,48)For Each objItem in colItems If InStr(objItem.SystemType, "86") <> 0 Then OSBit = "x86" sRegFile = "\\dc01\NETLOGON\x86.reg" ElseIf InStr(objItem.SystemType, "64") <> 0 Then OSBit = "x64" sRegFile = "\\dc01\NETLOGON\x64.reg" Else OSBit = objItem.SystemType End IfNextoShell.Run "regedit.exe /s " & Chr(34) & sRegFile & Chr(34), 0, True