Appendix A. Sample Visual Basic Scripts For Configuring Bios Settings; Restore Default Settings; List All Bios Settings On The Local Computer - Lenovo ThinkPad T400 Deployment Manual

Bios setup using windows management instrumentation deployment guide
Hide thumbs Also See for ThinkPad T400:
Table of Contents

Advertisement

Appendix A. Sample Visual Basic scripts for configuring BIOS
settings
The Visual Basic command line scripts in the ZIP file are examples that you may find helpful when
configuring BIOS settings.
The scripts in the ZIP file can be used as-is on Windows XP, Windows Vista, or Windows 7 to modify BIOS
settings on your Lenovo computer. The scripts can be executed on a command prompt using the cscript.exe
utility. On Windows Vista and Windows 7, you must run the scripts from an administrator command prompt.
Note: The scripts in this appendix are for reference only. To copy and paste scripts, use the scripts in
the ZIP file.

Restore default settings

Use the example scripts in the ZIP file as templates to restore default settings on the local computer.
Syntax: cscript.exe LoadDefaults.vbs
Example: cscript.exe LoadDefaults.vbs
'
' Load default BIOS settings
'
On Error Resume Next
Dim colItems
strComputer = "LOCALHOST"
Set objWMIService = GetObject("WinMgmts:" _
&"{ImpersonationLevel=Impersonate}!\\" & strComputer & "\root\wmi")
Set colItems = objWMIService.ExecQuery("Select * from Lenovo_LoadDefaultSettings")
strReturn = "error"
For Each objItem in colItems
ObjItem.LoadDefaultSettings ";", strReturn
Next
WScript.Echo " LoadDefaultSettings: " + strReturn
If strReturn <> "Success" Then
WScript.Quit
End If
Set colItems = objWMIService.ExecQuery("Select * from Lenovo_SaveBiosSettings")
strReturn = "error"
For Each objItem in colItems
ObjItem.SaveBiosSettings ";", strReturn
Next
WScript.Echo " SaveBiosSettings: " + strReturn

List all BIOS settings on the local computer

Use the sample scripts in the ZIP file as templates to list all BIOS settings and values on the local computer.
Syntax: cscript.exe ListAll.vbs Example: cscript.exe ListAll.vbs
© Copyright Lenovo 2008, 2012
' Change as needed.
17

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents