Lenovo ThinkPad T420 (English) BIOS Setup using Windows Management Instrumenta - Page 26

single, setting, local, computer

Page 26 highlights

' ' List all BIOS settings ' On Error Resume Next Dim colItems strComputer = "LOCALHOST" ' Change as needed. Set objWMIService = GetObject("WinMgmts:" _ &"{ImpersonationLevel=Impersonate}!\\" & strComputer & "\root\wmi") Set colItems = objWMIService.ExecQuery("Select * from Lenovo_BiosSetting") For Each objItem in colItems If Len(objItem.CurrentSetting) > 0 Then Setting = ObjItem.CurrentSetting StrItem = Left(ObjItem.CurrentSetting, InStr(ObjItem.CurrentSetting, ",") - 1) StrValue = Mid(ObjItem.CurrentSetting, InStr(ObjItem.CurrentSetting, ",") + 1, 256) WScript.Echo StrItem + " = " + StrValue End If Next Set a single BIOS setting on the local computer Use the sample scripts in the ZIP file as templates to set a single BIOS setting on the local computer. Syntax: cscript.exe SetConfig.vbs [Item] [Value]Example: cscript.exe SetConfig.vbs WakeOnLAN Disable ' ' Set specific BIOS Setting ' On Error Resume Next Dim colItems If WScript.Arguments.Count 2 Then WScript.Echo "SetConfig.vbs [setting] [value]" WScript.Quit End If strRequest = WScript.Arguments(0) + "," + WScript.Arguments(1) + ";" strComputer = "LOCALHOST" ' Change as needed. Set objWMIService = GetObject("WinMgmts:" _ &"{ImpersonationLevel=Impersonate}!\\" & strComputer & "\root\wmi") Set colItems = objWMIService.ExecQuery("Select * from Lenovo_SetBiosSetting") For Each objItem in colItems ObjItem.SetBiosSetting strRequest, strReturn Next WScript.Echo strRequest WScript.Echo " SetBiosSetting: " + strReturn If strReturn "Success" Then WScript.Quit End If 18 Lenovo BIOS Setup using Windows Management Instrumentation Deployment Guide

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40

´
´
/LVW
DOO
%,26
VHWWLQJV
´
2Q
(UURU
5HVXPH
1H[W
'LP
FRO,WHPV
VWU&RPSXWHU
° µ/2&$/+267µ
´
&KDQJH
DV
QHHGHG³
6HW
REM:0,6HUYLFH
°
*HW2EMHFW¶µ:LQ0JPWV²µ
B
·µ^,PSHUVRQDWLRQ/HYHO°,PSHUVRQDWH`¸??µ ·
VWU&RPSXWHU · µ?URRW?ZPLµ¹
6HW
FRO,WHPV
°
REM:0,6HUYLFH³([HF4XHU\¶µ6HOHFW
º
IURP
/HQRYRB%LRV6HWWLQJµ¹
)RU
(DFK
REM,WHP
LQ
FRO,WHPV
,I
/HQ¶REM,WHP³&XUUHQW6HWWLQJ¹
!
±
7KHQ
6HWWLQJ
°
2EM,WHP³&XUUHQW6HWWLQJ
6WU,WHP
°
/HIW¶2EM,WHP³&XUUHQW6HWWLQJ¼
,Q6WU¶2EM,WHP³&XUUHQW6HWWLQJ¼ µ¼µ¹
¿
À¹
6WU9DOXH
°
0LG¶2EM,WHP³&XUUHQW6HWWLQJ¼
,Q6WU¶2EM,WHP³&XUUHQW6HWWLQJ¼ µ¼µ¹
½
À¼
ÁÂù
:6FULSW³(FKR
6WU,WHP
½µ
°µ
½
6WU9DOXH
(QG
,I
1H[W
Set
a
single
BIOS
setting
on
the
local
computer
Use
the
sample
scripts
in
the
ZIP
±le
as
templates
to
set
a
single
BIOS
setting
on
the
local
computer.
Syntax
:
FVFULSW³H[H
6HW&RQúJ³YEV
>,WHP@
>9DOXH@
Example
:
FVFULSW³H[H
6HW&RQúJ³YEV
:DNH2Q/$1
'LVDEOH
´
´
6HW
VSHFLúF
%,26
6HWWLQJ
´
2Q
(UURU
5HVXPH
1H[W
'LP
FRO,WHPV
,I
:6FULSW³$UJXPHQWV³&RXQW
¾!
Á
7KHQ
:6FULSW³(FKR µ6HW&RQúJ³YEV
>VHWWLQJ@
>YDOXH@µ
:6FULSW³4XLW
(QG
,I
VWU5HTXHVW
°
:6FULSW³$UJXPHQWV¶±¹
½ µ¼µ
½
:6FULSW³$UJXPHQWV¶À¹
½ µ»µ
VWU&RPSXWHU
° µ/2&$/+267µ
´
&KDQJH
DV
QHHGHG³
6HW
REM:0,6HUYLFH
°
*HW2EMHFW¶µ:LQ0JPWV²µ
B
·µ^,PSHUVRQDWLRQ/HYHO°,PSHUVRQDWH`¸??µ ·
VWU&RPSXWHU · µ?URRW?ZPLµ¹
6HW
FRO,WHPV
°
REM:0,6HUYLFH³([HF4XHU\¶µ6HOHFW
º
IURP
/HQRYRB6HW%LRV6HWWLQJµ¹
)RU
(DFK
REM,WHP
LQ
FRO,WHPV
2EM,WHP³6HW%LRV6HWWLQJ
VWU5HTXHVW¼
VWU5HWXUQ
1H[W
:6FULSW³(FKR
VWU5HTXHVW
:6FULSW³(FKR µ
6HW%LRV6HWWLQJ² µ
½
VWU5HWXUQ
,I
VWU5HWXUQ
¾! µ6XFFHVVµ
7KHQ
:6FULSW³4XLW
(QG
,I
18
Lenovo
BIOS
Setup
using
Windows
Management
Instrumentation
Deployment
Guide