Set A Single Bios Setting On The Local Computer - Lenovo BIOS Windows Management Deployment Manual

Bios windows management instrumentation interface
Table of Contents

Advertisement

Syntax: cscript.exe ListAll.vbs
Example: cscript.exe ListAll.vbs
'
' List all BIOS settings
'
On Error Resume Next
Dim colItems
strComputer = "LOCALHOST"
Set objWMIService = GetObject("WinMgmts:" _
Set colItems = objWMIService.ExecQuery("Select * from Lenovo_BiosSetting")
For Each objItem in colItems
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
End If
strRequest = WScript.Arguments(0) + "," + WScript.Arguments(1) + ";"
strComputer = "LOCALHOST"
Set objWMIService = GetObject("WinMgmts:" _
Set colItems = objWMIService.ExecQuery("Select * from Lenovo_SetBiosSetting")
For Each objItem in colItems
Next
WScript.Echo strRequest
WScript.Echo " SetBiosSetting: " + strReturn
If strReturn <> "Success" Then
End If
Set colItems = objWMIService.ExecQuery("Select * from Lenovo_SaveBiosSettings")
14
Lenovo BIOS Windows Management Instrumentation Interface Deployment Guide
&"{ImpersonationLevel=Impersonate}!\\" & strComputer & "\root\wmi")
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
WScript.Echo "SetConfig.vbs [setting] [value]"
WScript.Quit
&"{ImpersonationLevel=Impersonate}!\\" & strComputer & "\root\wmi")
ObjItem.SetBiosSetting strRequest, strReturn
WScript.Quit
' Change as needed.
' Change as needed.

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents