Users Guide

'*** and that all parameters were passed
If (LCase(Right(WScript.FullName, 11)) = "wscript.exe" ) Or _
(Wscript.Arguments.Count<2)Then
CallUsage()
WScript.Quit
End If
'*** Initialize variables
strNameSpace = "root/Dellomci"
strComputerName = WScript.Arguments(0)
strClassName = "Dell_Configuration"
strPropValue = "Configuration"
strMethod = "FlashBios"
'*** Retrieve the Dell_Configuration class
Set objClass = GetObject("WinMgmts:{impersonationLevel=impersonate}//" & _
strComputerName&"/"&strNameSpace&":"&strClassName)
Set objMethod = objClass.Methods_(strMethod)
'*** Set the In parameter of the method to the URL of BIOS header file
Set objInParam = objMethod.inParameters.SpawnInstance_()
objInParam.sUrl = WScript.Arguments(1)
'*** Execute the method
Set ObjOutParam = objClass.ExecMethod_(strMethod, objInParam)
'*** Let the user know whether the method returned success or not
'*** Note: if return value is 0, it does not mean the system's BIOS has
'*** been flashed, it only means that the flash method was initiated
'*** successfully.
If objOutParam.ReturnValue = 0 Then
WScript.Echo"Methodcompletedsuccessfully."
else
WScript.Echo"Methodfailed."
End If
'*** Sub used to display the correct usage of the script
Sub Usage()
Dim strMessage
strMessage = "incorrect syntax. You should run: " & vbCRLF & _
"cscript.exe//nologoSampleFlash.vbs<systemname><URLofBIOS
headerfile>"
WScript.Echo strMessage
End Sub
('****************************************************
'*** 名称:SampleFlash.vbs
'*** 目的:刷写 Dell OMCI 客户端的 BIOS
'*** 用法:cscript.exe //nologo SampleFlash.vbs <系统名称>
'*** <BIOS 标头文件的 URL>
'***
'*** 此示例脚本只是一个示例,未经
'*** 测试,Dell 也不作任何担保;Dell
'*** 相关的责任概不负责。Dell
'*** 该脚本不提供任何技术支持。有关
'*** WMI 脚本的详情,请参阅适用的 Microsoft 说明文件。
'****************************************************
选项显式
'*** 声明变量
Dim strNameSpace
Dim strComputerName
Dim strClassName
Dim strPropValue
Dim objInstance
Dim ObjOutParam
Dim strMethod
Dim objMethod
Dim objClass
Dim objInParam
'*** 确认使用了正确的可执行文件运行脚本
'*** 并且所有参数均已传递
If (LCase(Right(WScript.FullName, 11)) = "wscript.exe" ) Or _
(Wscript.Arguments.Count<2)Then
CallUsage()
WScript.Quit
End If
'*** 初始化变量
strNameSpace = "root/Dellomci"
strComputerName = WScript.Arguments(0)
strClassName = "Dell_Configuration"
strPropValue = "Configuration"
strMethod = "FlashBios"