Users Guide
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"Methodcompletedsuccessfully."
else
WScript.Echo"Methodfailed."
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//nologoSampleFlash.vbs<systemname><URLofBIOS
headerfile>"
WScript.Echo strMessage
End Sub
('****************************************************
'*** Nombre: SampleFlash.vbs
'*** Objetivo: actualizar el BIOS de un cliente Dell OMCI.
'*** Uso: cscript.exe //nologo SampleFlash.vbs <nombre_del_sistema> <URL
'*** del archivo de encabezado del BIOS>
'***
'***Estasecuenciadecomandosdemuestraseproporcionaúnicamentecomoejemploynoha
'***sidoprobabanitieneningunagarantíaporpartedeDell;Dellseeximedetoda
'***responsabilidadenconexiónconestasecuenciadecomandos.Dellnoproporcionaasistencia
'***técnicarelacionadaconestetipodesecuenciasdecomandos.Paraobtenermásinformaciónsobre
'***secuenciasdecomandosdeWMI,consulteladocumentacióncorrespondientedeMicrosoft.
'****************************************************
Opciónexplícita
'*** Declarar variables
Dim strNameSpace
Dim strComputerName
Dim strClassName
Dim strPropValue
Dim objInstance
Dim ObjOutParam
Dim strMethod
Dim objMethod
Dim objClass
Dim objInParam
'***Comprobarqueseutilizóelarchivoejecutablecorrectoparaejecutarlasecuenciadecomandos
'***yqueseproporcionarontodoslosparámetros
If (LCase(Right(WScript.FullName, 11)) = "wscript.exe" ) Or _
(Wscript.Arguments.Count<2)Then
CallUsage()
WScript.Quit
End If
'*** Inicializar las variables
strNameSpace = "root/Dellomci"
strComputerName = WScript.Arguments(0)
strClassName = "Dell_Configuration"
strPropValue = "Configuration"
strMethod = "FlashBios"
'*** Recuperar la clase Dell_Configuration
Set objClass = GetObject("WinMgmts:{impersonationLevel=impersonate}//" & _
strComputerName&"/"&strNameSpace&":"&strClassName)
Set objMethod = objClass.Methods_(strMethod)
'***EstablecerelparámetrodeentradadelmétodoparaelURLdelarchivodeencabezadodelBIOS
Set objInParam = objMethod.inParameters.SpawnInstance_()
objInParam.sUrl = WScript.Arguments(1)
'***Ejecutarelmétodo
Set ObjOutParam = objClass.ExecMethod_(strMethod, objInParam)
'***Informaralusuariosielmétodoseejecutósatisfactoriamente










