FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Algunas cosas Interesantes con WMI
Posts: 625
Joined: Wed Mar 14, 2007 06:49 PM
Algunas cosas Interesantes con WMI
Posted: Thu Apr 10, 2008 02:53 PM
:-) :-) Saludos a toda la Comunidad: :-) :-)

Pongo a su disposición algunas funciones que he encontrado investigando un poco con WMI, ojala y a alguien le pueda servir, Si alguin más las puede complementar que mejor para que tengamos un mejor conocimiento de las posibilidades que podemos tener con esta tecnología.


#Include "FIVEWIN.CH"

Funcion Main()

LOCAL  oDatos
LOCAL    nFree:= ""
LOCAL     oLoc:= CreateObject( "wbemScripting.SwbemLocator" )
LOCAL   objWMI:= oLoc:ConnectServer() 
LOCAL oSistema:= objWMI:ExecQuery("Select * from Win32_PhysicalMedia")
LOCAL   oDisco:= objWMI:ExecQuery("Select * from Win32_LogicalDisk")
LOCAL   oParti:= objWMI:ExecQuery("Select * from CIM_DiskPartition")
LOCAL  oDisket:= objWMI:ExecQuery("Select * From Win32_LogicalDisk Where DeviceID = 'A:'")
LOCAL   objUnd:= objWMI:ExecQuery("Select * from Win32_MappedLogicalDisk")
LOCAL     oUnd:= objWMI:ExecQuery("Select * from Win32_CDROMDrive")
LOCAL  oResolu:= objWMI:ExecQuery("Select * from Win32_DesktopMonitor")
LOCAL  oSistem:= objWMI:ExecQuery("Select * from Win32_OperatingSystem")
LOCAL   oUsers:= objWMI:ExecQuery("Select * from Win32_Account")
LOCAL    oServ:= objWMI:ExecQuery("Select * from Win32_Service Where Name = 'Themes'")
LOCAL    oTime:= objWMI:ExecQuery("Select * from Win32_LocalTime")
LOCAL oJbs := oSrv:ExecQuery( "SELECT * FROM Win32_BaseBoard" )


FOR Each oDatos In oSistema
    MsgInfo("Serial de fabrica: " + ALLTRIM(cValToChar(oDatos:SerialNumber)),"Numero de serie del disco duro")
NEXT



FOR Each oDatos In oDisco
    MsgInfo("Unidad: " + ALLTRIM(cValToChar(oDatos:Name)) + "\   Serial: " + ALLTRIM(cValToChar(oDatos:VolumeSerialNumber)),"Unidad y serial lógico de las unidades de disco")
NEXT



FOR Each oDatos in oParti 
    MsgInfo(ALLTRIM(cValToChar(oDatos:Name)) + " - Tamaño: " +ALLTRIM(cValToChar(oDatos:Size)) + " En: " + ALLTRIM(cValToChar(oDatos:SystemName)) + " - Tipo: " + ALLTRIM(cValToChar(oDatos:TYPE)),"Particiones disponibles")
NEXT



FOR Each oDatos in oDisket
    nFree:= oDatos:FreeSpace
   
   IF VALTYPE(nFree) = "U"
         MsgInfo("No hay diskete en la unidad A:\","Aviso del WMI de Windows")
   ELSE
         MsgStop("Hay un diskete en la unidad A:\","Aviso del WMI de Windows")
   ENDIF
   
NEXT



FOR Each oDatos In objUnd
    MsgInfo("Device ID: " + oDatos:DeviceID +" Nombre: " + oDatos:Name +" Espacio Libre: " + cValtoChar(oDatos:FreeSpace) + " Tamaño: " + cValtoChar(oDatos:Size),"Lista de unidades Mapeadas en Mi PC")    
NEXT



FOR Each oDatos in oUnd
    MsgInfo("Unidad: " + oDatos:Drive + " " + "Nombre: " + oDatos:Caption,"Unidades de CD instaladas en el equipo")
NEXT


 
FOR Each oDatos in oResolu
   MsgInfo("Trabajando a Resolución de Alto: " + cValToChar(oDatos:ScreenHeight) + "  y Ancho: " + cValToChar(oDatos:ScreenWidth),"Resolucion de Panralla")
NEXT



FOR Each oDatos In oSistem
    MsgInfo(oDatos:InstallDate,"Fecha de Instalación de Windows XP")
NEXT



FOR Each oDatos in oSistem
    MsgInfo("Directorio de Windows es: " + oDatos:WindowsDirectory +"  Directorio del Sistema es: "+ oDatos:SystemDirectory,"Directorio de Windows y del Sistema")
NEXT



FOR Each oDatos in oUsers
    MsgInfo(cValToChar(oDatos:Name) + " - " + cValToChar(oDatos:Caption),"Lista de Usuarios de Windows")
NEXT



MsgInfo("Deshabilitarndo los Themes en Windows XP")
FOR Each oDatos in oServ    
    oDatos:StopService()
    SysRefresh()
NEXT



MsgInfo("Habilitando los Themes en Windows XP")
FOR Each oDatos in oServ    
    oDatos:StartService()
    SysRefresh()
NEXT


 
FOR Each oDatos in oSistem
    MsgInfo(oDatos:Caption + " " + oDatos:VERSION,"Sistemas operativos instalados en el PC")
NEXT


 
FOR Each oDatos in oTime
     MsgInfo( "Día: " + cValToChar(oDatos:DAY) + CRLF +;
              "Día de la semana: " + cValToChar(oDatos:DayOfWeek) + CRLF +;
              "Hora: " + cValToChar(oDatos:Hour) + CRLF +;
              "Minutos: " + cValToChar(oDatos:Minute) + CRLF +;
              "Mes: " + cValToChar(oDatos:MONTH) + CRLF +;
              "Segundos: " + cValToChar(oDatos:Second) + CRLF +;
              "Semana en el mes: " + cValToChar(oDatos:WeekInMonth) + CRLF +;
              "Año: " + cValToChar(oDatos:YEAR),"Dia, Hora, Mes y Año desde WMI")
NEXT


FOR EACH oDatos IN oJbs 
        MsgInfo("El Número de Serie de la MotherBoard es: "+Alltrim(cValtoChar(oJob:SerialNumber)),"Desde WMI")
NEXT

Return nil



Un furte Abrazo y Saludos...
Soluciones y Diseño de Software
Damos Soluciones...

I.S.C. Victor Daniel Cuatecatl Leon
Director y Diseñador de Proyectos

http://www.soldisoft.unlugar.com
http://www.sisa.unlugar.com
danyleon82@hotmail.com
www.facebook.com/victordaniel.cuatecatlleon
Posts: 73
Joined: Thu Dec 06, 2007 04:51 PM
Algunas cosas Interesantes con WMI
Posted: Thu Apr 10, 2008 03:57 PM

BIEN CHIAPAS,

ME AHORRASTE LA INVESTIGACION, Y SE PRODRIA SABER DONDE LO CONSULTASTE?

SALUDOS, JOSE MARQUEZ

JUAN DIAZ COVARRUBIAS,VERACRUZ ,MEXICO
Posts: 625
Joined: Wed Mar 14, 2007 06:49 PM
Algunas cosas Interesantes con WMI
Posted: Thu Apr 10, 2008 04:58 PM
Saludos al Bello estado de Veracruz: :-) :-)


Estimado Josemar.. .

Todos estos datos lo he recopilado de:

http://www.davphantom.net/modulo.asp?op=3

Hay algunas cosillas más por ahi en esa pagina, pero algunas no me funcionaron y algunas otras no les tome mucha importancia...

Revisa alomejor algomas te puede servir...

Saludos..
Soluciones y Diseño de Software
Damos Soluciones...

I.S.C. Victor Daniel Cuatecatl Leon
Director y Diseñador de Proyectos

http://www.soldisoft.unlugar.com
http://www.sisa.unlugar.com
danyleon82@hotmail.com
www.facebook.com/victordaniel.cuatecatlleon
Posts: 73
Joined: Thu Dec 06, 2007 04:51 PM
Algunas cosas Interesantes con WMI
Posted: Thu Apr 10, 2008 05:16 PM

chiapas,

ya vi el enlace y como dices hay buscar las cosas interesantes, gracias por el tip y le voy a ivestigar mas.

SALUDOS, JOSE MARQUEZ

JUAN DIAZ COVARRUBIAS,VERACRUZ ,MEXICO
Posts: 782
Joined: Wed Dec 19, 2007 07:50 AM
Re: Algunas cosas Interesantes con WMI
Posted: Thu Apr 10, 2008 06:19 PM
cuatecatl82 wrote:Pongo a su disposición algunas funciones que he encontrado investigando un poco con WMI, ojala y a alguien le pueda servir, Si alguin más las puede complementar que mejor para que tengamos un mejor conocimiento de las posibilidades que podemos tener con esta tecnología.

Muchas gracias Víctor por seguir compartiendo con nosotros tus trabajos que siempre resultan tan útiles.

cuatecatl82 wrote:Un furte Abrazo y Saludos...

Me quedo con el abrazo y los saludos, no sea que el "furte" resulte ser una grosería Chiapaneca :-)

Yo nada más te mando un abrazote.

Manuel Mercado
manuelmercado at prodigy dot net dot mx
Posts: 625
Joined: Wed Mar 14, 2007 06:49 PM
Algunas cosas Interesantes con WMI
Posted: Thu Apr 10, 2008 09:29 PM
Gracias Estimado Manuel Mercado:

Gracias por tus palabras, siempre he dicho que si algo valioso aprendes, o sabes es bueno compartirlo con todos los que te rodean, es posible que a alguien ayudes aunque sea con un granito de arena...

Me gusta aprender y enseñar lo aprendido, si a alguien puedo ayudar con lo poco que se, será para mi un placer poderlo ayudar...

Y que más que aportar un poquito a toda esta comunidad de compañeros fivewineros que tanto me han ayudado...

Perdón por lo de "furte", la palabra correcta es "fuerte"..


Saludos desde Chiapas.. :-) :-)
Soluciones y Diseño de Software
Damos Soluciones...

I.S.C. Victor Daniel Cuatecatl Leon
Director y Diseñador de Proyectos

http://www.soldisoft.unlugar.com
http://www.sisa.unlugar.com
danyleon82@hotmail.com
www.facebook.com/victordaniel.cuatecatlleon
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Algunas cosas Interesantes con WMI
Posted: Fri Apr 11, 2008 09:29 AM
there are many errors
[1]:Harbour.Exe testinfo.prg  /m /n0 /w2 /es2 /iC:\work\FWH\include /ic:\work\xHarbour\Include /iinclude;c:\work\BCC55\Bin\include;c:\work\xHarbour\include;c:\work\fwh\include;c:\work\include; /oObj\testinfo.c
xHarbour Compiler build 1.1.0 (SimpLex)
Copyright 1999-2007, http://www.xharbour.org http://www.harbour-project.org/
Compiling 'testinfo.prg'...
testinfo.prg(3) Error E0030  Syntax error: "parse error at 'MAIN'"
testinfo.prg(5) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(6) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(6) Warning W0001  Ambiguous reference: 'NFREE'
testinfo.prg(7) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(7) Warning W0001  Ambiguous reference: 'OLOC'
testinfo.prg(8) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(8) Warning W0001  Ambiguous reference: 'OLOC'
testinfo.prg(8) Warning W0001  Ambiguous reference: 'OBJWMI'
testinfo.prg(9) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(9) Warning W0001  Ambiguous reference: 'OBJWMI'
testinfo.prg(9) Warning W0001  Ambiguous reference: 'OSISTEMA'
testinfo.prg(10) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(10) Warning W0001  Ambiguous reference: 'OBJWMI'
testinfo.prg(10) Warning W0001  Ambiguous reference: 'ODISCO'
testinfo.prg(11) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(11) Warning W0001  Ambiguous reference: 'OBJWMI'
testinfo.prg(11) Warning W0001  Ambiguous reference: 'OPARTI'
testinfo.prg(12) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(12) Warning W0001  Ambiguous reference: 'OBJWMI'
testinfo.prg(12) Warning W0001  Ambiguous reference: 'ODISKET'
testinfo.prg(13) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(13) Warning W0001  Ambiguous reference: 'OBJWMI'
testinfo.prg(13) Warning W0001  Ambiguous reference: 'OBJUND'
testinfo.prg(14) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(14) Warning W0001  Ambiguous reference: 'OBJWMI'
testinfo.prg(14) Warning W0001  Ambiguous reference: 'OUND'
testinfo.prg(15) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(15) Warning W0001  Ambiguous reference: 'OBJWMI'
testinfo.prg(15) Warning W0001  Ambiguous reference: 'ORESOLU'
testinfo.prg(16) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(16) Warning W0001  Ambiguous reference: 'OBJWMI'
testinfo.prg(16) Warning W0001  Ambiguous reference: 'OSISTEM'
testinfo.prg(17) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(17) Warning W0001  Ambiguous reference: 'OBJWMI'
testinfo.prg(17) Warning W0001  Ambiguous reference: 'OUSERS'
testinfo.prg(18) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(18) Warning W0001  Ambiguous reference: 'OBJWMI'
testinfo.prg(18) Warning W0001  Ambiguous reference: 'OSERV'
testinfo.prg(19) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(19) Warning W0001  Ambiguous reference: 'OBJWMI'
testinfo.prg(19) Warning W0001  Ambiguous reference: 'OTIME'
testinfo.prg(20) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(20) Warning W0001  Ambiguous reference: 'OSRV'
testinfo.prg(20) Warning W0001  Ambiguous reference: 'OJBS'
testinfo.prg(23) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(23) Warning W0001  Ambiguous reference: 'OSISTEMA'
testinfo.prg(24) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(24) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(25) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(29) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(29) Warning W0001  Ambiguous reference: 'ODISCO'
testinfo.prg(30) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(30) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(30) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(31) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(35) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(35) Warning W0001  Ambiguous reference: 'OPARTI'
testinfo.prg(36) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(36) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(36) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(36) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(36) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(37) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(41) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(41) Warning W0001  Ambiguous reference: 'ODISKET'
testinfo.prg(42) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(42) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(42) Warning W0001  Ambiguous reference: 'NFREE'
testinfo.prg(44) Warning W0001  Ambiguous reference: 'NFREE'
testinfo.prg(45) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(47) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(48) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(50) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(54) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(54) Warning W0001  Ambiguous reference: 'OBJUND'
testinfo.prg(55) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(55) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(55) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(55) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(55) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(56) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(60) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(60) Warning W0001  Ambiguous reference: 'OUND'
testinfo.prg(61) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(61) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(61) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(62) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(66) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(66) Warning W0001  Ambiguous reference: 'ORESOLU'
testinfo.prg(67) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(67) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(67) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(68) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(72) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(72) Warning W0001  Ambiguous reference: 'OSISTEM'
testinfo.prg(73) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(73) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(74) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(78) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(78) Warning W0001  Ambiguous reference: 'OSISTEM'
testinfo.prg(79) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(79) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(79) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(80) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(84) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(84) Warning W0001  Ambiguous reference: 'OUSERS'
testinfo.prg(85) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(85) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(85) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(86) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(90) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(91) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(91) Warning W0001  Ambiguous reference: 'OSERV'
testinfo.prg(92) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(92) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(93) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(94) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(98) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(99) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(99) Warning W0001  Ambiguous reference: 'OSERV'
testinfo.prg(100) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(100) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(101) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(102) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(106) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(106) Warning W0001  Ambiguous reference: 'OSISTEM'
testinfo.prg(107) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(107) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(107) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(108) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(112) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(112) Warning W0001  Ambiguous reference: 'OTIME'
testinfo.prg(120) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(120) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(120) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(120) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(120) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(120) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(120) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(120) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(120) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(121) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(124) Warning W0001  Ambiguous reference: 'ODATOS'
testinfo.prg(124) Warning W0001  Ambiguous reference: 'OJBS'
testinfo.prg(125) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(125) Warning W0001  Ambiguous reference: 'OJOB'
testinfo.prg(126) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(128) Error E0001  Statement not allowed outside of procedure or function
testinfo.prg(128) Warning W0006  Procedure returns value
55 errors

No code generated
Best Regards, Saludos



Falconi Silvio
Posts: 593
Joined: Sat May 12, 2007 11:47 AM
Algunas cosas Interesantes con WMI
Posted: Fri Apr 11, 2008 11:41 AM

Silvio,

Solo cambia la línea 3, de "Funcion Main() " a Function Main()

Single it changes line 3, of "Funcion Main() " to Function Main()

Rolando :D

Posts: 654
Joined: Mon May 29, 2006 03:14 PM
Algunas cosas Interesantes con WMI
Posted: Mon Dec 08, 2008 12:21 AM
Y como se leerían com WMI todos los datos de red... algo así como el ipconfig /all de consola de MS-DOS.

Este tipo de datos:
Adaptador Ethernet Conexión de área local          :

        Sufijo de conexión específica DNS :
        Descripción. . . . . . . . . . .  : NIC TX PCI 10/100 de 3Com EtherLinkXL (3C905B-TX)
        Dirección física. . . . . . . . . : ff-ff-ff-ee-ee-ee
        DHCP habilitado. . . . . . . . .  : No
        Dirección IP. . . . . . . . . . . : 194.194.194.100
        Máscara de subred . . . . . . . . : 255.255.255.0
        Puerta de enlace predeterminada   : 194.194.194.100
        Servidores DNS . . . . . . . . . .: 194.194.194.100
                                            fec0:0:0:ffff::1%1
Mi abuelo decía: Los aviones vuelan porque Dios quiere, y los helicópteros ni Dios sabe porque vuelan.

FWH 16.02, xHarbour 1.2.3, Harbour 3.2.0, WorkShop 4.5, AJ Make 0.30, Borlan BCC 7.00, VisualStudio 2013
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Algunas cosas Interesantes con WMI
Posted: Mon Dec 08, 2008 07:15 AM

Thank you for this interesting function.

Regards,
Otto

This line errors out:
What object is oSrv?
//LOCAL oJbs := oSrv:ExecQuery( "SELECT * FROM Win32_BaseBoard" )
I get an error:
Error description: Error BASE/1003 Variable does not exist: OSRV

Posts: 1286
Joined: Mon Feb 25, 2008 02:54 PM
Algunas cosas Interesantes con WMI
Posted: Mon Dec 08, 2008 10:06 AM

I get an error:
Error description: Error BASE/1003 Variable does not exist: OSRV

ubiratanmga@gmail.com

FWH24.04
BCC7.3
HARBOUR3.2
xMate
Pelles´C
TDolphin
Posts: 117
Joined: Mon Aug 13, 2007 05:22 PM
Algunas cosas Interesantes con WMI
Posted: Mon Dec 08, 2008 06:26 PM

Basta vc trocar

//LOCAL oJbs := oSrv:ExecQuery( "SELECT * FROM Win32_BaseBoard")
por

LOCAL oJbs := objWMI:ExecQuery( "select * from Win32_BaseBoard" )
Pos objWMI é o resultado de objWMI:= oLoc:ConnectServer()

blz

um abraço
Marcelo Ferro

Marcelo Ferro da Silveira

Fwh14.04/xHarbour 1.2.3 Simplex / Bcc582 / Pelles 8

SqlLib /xMate/WS
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Algunas cosas Interesantes con WMI
Posted: Thu Dec 11, 2008 12:21 PM
Este esta correcto?
   FOR EACH oDatos IN oJbs
    MsgInfo("El Número de Serie de la MotherBoard es: "+Alltrim(cValtoChar(oJob:SerialNumber)),"Desde WMI")
   NEXT


??-> oJob:SerialNumber -> VARIABLE oJob no ejiste
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 581
Joined: Tue Oct 11, 2005 11:28 AM
Algunas cosas Interesantes con WMI
Posted: Thu Dec 11, 2008 02:22 PM

Joao,

No seria oJbs en vez de oJob ??

Saludos

Kleyber Derick



FWH / xHb / xDevStudio / SQLLIB
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Algunas cosas Interesantes con WMI
Posted: Thu Dec 11, 2008 02:55 PM
Kleyber wrote:Joao,

No seria oJbs en vez de oJob ??

Saludos


Hi, dear friend.

te funciona asi?

Voy intentar.

Saludos y un fuerte abrazo.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341